<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>RF22: RF22.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">RF22
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">RF22.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// RF22.h</span>
<a name="l00002"></a>00002 <span class="comment">// Author: Mike McCauley (mikem@open.com.au)</span>
<a name="l00003"></a>00003 <span class="comment">// Copyright (C) 2011 Mike McCauley</span>
<a name="l00004"></a>00004 <span class="comment">// $Id: RF22.h,v 1.20 2011/11/24 00:29:58 mikem Exp mikem $</span>
<a name="l00005"></a>00005 <span class="comment">//</span><span class="comment"></span>
<a name="l00006"></a>00006 <span class="comment">/// \mainpage RF22 library for Arduino</span>
<a name="l00007"></a>00007 <span class="comment">///</span>
<a name="l00008"></a>00008 <span class="comment">/// This is the Arduino RF22 library.</span>
<a name="l00009"></a>00009 <span class="comment">/// It provides an object-oriented interface for sending and receiving data messages with Hope-RF</span>
<a name="l00010"></a>00010 <span class="comment">/// RF22B based radio modules, and compatible chips and modules, including the RFM22B transceiver module such as </span>
<a name="l00011"></a>00011 <span class="comment">/// this one: http://www.sparkfun.com/products/10153</span>
<a name="l00012"></a>00012 <span class="comment">///</span>
<a name="l00013"></a>00013 <span class="comment">/// RF22 also supports some of the features of ZigBee and XBee, </span>
<a name="l00014"></a>00014 <span class="comment">/// (such as mesh routing and automatic route discovery), </span>
<a name="l00015"></a>00015 <span class="comment">/// but with a much less complicated system and less expensive radios.</span>
<a name="l00016"></a>00016 <span class="comment">///</span>
<a name="l00017"></a>00017 <span class="comment">/// The Hope-RF (http://www.hoperf.com) RFM22B (http://www.hoperf.com/rf_fsk/fsk/RFM22B.htm) </span>
<a name="l00018"></a>00018 <span class="comment">/// is a low-cost ISM transceiver module. It supports FSK, GFSK, OOK over a wide </span>
<a name="l00019"></a>00019 <span class="comment">/// range of frequencies and programmable data rates.</span>
<a name="l00020"></a>00020 <span class="comment">///</span>
<a name="l00021"></a>00021 <span class="comment">/// This library provides functions for sending and receiving messages of up to 255 octets on any </span>
<a name="l00022"></a>00022 <span class="comment">/// frequency supported by the RF22B, in a range of predefined data rates and frequency deviations. </span>
<a name="l00023"></a>00023 <span class="comment">/// Frequency can be set with 312Hz precision to any frequency from 240.0MHz to 960.0MHz.</span>
<a name="l00024"></a>00024 <span class="comment">///</span>
<a name="l00025"></a>00025 <span class="comment">/// Up to 2 RF22B modules can be connected to an Arduino, permitting the construction of translators</span>
<a name="l00026"></a>00026 <span class="comment">/// and frequency changers, etc.</span>
<a name="l00027"></a>00027 <span class="comment">///</span>
<a name="l00028"></a>00028 <span class="comment">/// This library provides classes for </span>
<a name="l00029"></a>00029 <span class="comment">/// - RF22: unaddressed, unreliable messages</span>
<a name="l00030"></a>00030 <span class="comment">/// - RF22Datagram: addressed, unreliable messages</span>
<a name="l00031"></a>00031 <span class="comment">/// - RF22ReliableDatagram: addressed, reliable, retransmitted, acknowledged messages.</span>
<a name="l00032"></a>00032 <span class="comment">/// - RF22Router: multi hop delivery from source node to destination node via 0 or more intermediate nodes</span>
<a name="l00033"></a>00033 <span class="comment">/// - RF22Mesh: multi hop delivery with automatic route discovery and rediscovery.</span>
<a name="l00034"></a>00034 <span class="comment">///</span>
<a name="l00035"></a>00035 <span class="comment">/// The following modulation types are suppported with a range of modem configurations for </span>
<a name="l00036"></a>00036 <span class="comment">/// common data rates and frequency deviations:</span>
<a name="l00037"></a>00037 <span class="comment">/// - GFSK Gaussian Frequency Shift Keying</span>
<a name="l00038"></a>00038 <span class="comment">/// - FSK Frequency Shift Keying</span>
<a name="l00039"></a>00039 <span class="comment">/// - OOK On-Off Keying</span>
<a name="l00040"></a>00040 <span class="comment">///</span>
<a name="l00041"></a>00041 <span class="comment">/// Support for other RF22B features such as on-chip temperature measurement, analog-digital </span>
<a name="l00042"></a>00042 <span class="comment">/// converter, transmitter power control etc is also provided.</span>
<a name="l00043"></a>00043 <span class="comment">///</span>
<a name="l00044"></a>00044 <span class="comment">/// The latest version of this documentation can be downloaded from </span>
<a name="l00045"></a>00045 <span class="comment">/// http://www.open.com.au/mikem/arduino/RF22</span>
<a name="l00046"></a>00046 <span class="comment">///</span>
<a name="l00047"></a>00047 <span class="comment">/// Example Arduino programs are included to show the main modes of use.</span>
<a name="l00048"></a>00048 <span class="comment">///</span>
<a name="l00049"></a>00049 <span class="comment">/// The version of the package that this documentation refers to can be downloaded </span>
<a name="l00050"></a>00050 <span class="comment">/// from http://www.open.com.au/mikem/arduino/RF22/RF22-1.13.zip</span>
<a name="l00051"></a>00051 <span class="comment">/// You can find the latest version at http://www.open.com.au/mikem/arduino/RF22</span>
<a name="l00052"></a>00052 <span class="comment">///</span>
<a name="l00053"></a>00053 <span class="comment">/// You can also find online help and disussion at http://groups.google.com/group/rf22-arduino</span>
<a name="l00054"></a>00054 <span class="comment">///</span>
<a name="l00055"></a>00055 <span class="comment">/// Tested on Arduino Diecimila and Mega with arduino-0021 </span>
<a name="l00056"></a>00056 <span class="comment">/// on OpenSuSE 11.1 and avr-libc-1.6.1-1.15,</span>
<a name="l00057"></a>00057 <span class="comment">/// cross-avr-binutils-2.19-9.1, cross-avr-gcc-4.1.3_20080612-26.5.</span>
<a name="l00058"></a>00058 <span class="comment">/// With HopeRF RFM22 modules that appear to have RF22B chips on board:</span>
<a name="l00059"></a>00059 <span class="comment">///    - Device Type Code = 0x08 (RX/TRX)</span>
<a name="l00060"></a>00060 <span class="comment">///    - Version Code = 0x06</span>
<a name="l00061"></a>00061 <span class="comment">/// It is known not to work on Diecimila. Dont bother trying.</span>
<a name="l00062"></a>00062 <span class="comment">///</span>
<a name="l00063"></a>00063 <span class="comment">/// \par Packet Format</span>
<a name="l00064"></a>00064 <span class="comment">///</span>
<a name="l00065"></a>00065 <span class="comment">/// All messages sent and received by this RF22 library must conform to this packet format:</span>
<a name="l00066"></a>00066 <span class="comment">///</span>
<a name="l00067"></a>00067 <span class="comment">/// - 8 nibbles (4 octets) PREAMBLE</span>
<a name="l00068"></a>00068 <span class="comment">/// - 2 octets SYNC 0x2d, 0xd4</span>
<a name="l00069"></a>00069 <span class="comment">/// - 4 octets HEADER: (TO, FROM, ID, FLAGS)</span>
<a name="l00070"></a>00070 <span class="comment">/// - 1 octet LENGTH (0 to 255), number of octets in DATA</span>
<a name="l00071"></a>00071 <span class="comment">/// - 0 to 255 octets DATA</span>
<a name="l00072"></a>00072 <span class="comment">/// - 2 octets CRC computed with CRC16(IBM), computed on HEADER, LENGTH and DATA</span>
<a name="l00073"></a>00073 <span class="comment">///</span>
<a name="l00074"></a>00074 <span class="comment">/// For technical reasons, the message format is not compatible with the </span>
<a name="l00075"></a>00075 <span class="comment">/// &#39;HopeRF Radio Transceiver Message Library for Arduino&#39; http://www.open.com.au/mikem/arduino/HopeRF from the same author. Nor is it compatible with </span>
<a name="l00076"></a>00076 <span class="comment">/// &#39;Virtual Wire&#39; http://www.open.com.au/mikem/arduino/VirtualWire.pdf also from the same author.</span>
<a name="l00077"></a>00077 <span class="comment">///</span>
<a name="l00078"></a>00078 <span class="comment">/// \par Connecting RFM-22 to Arduino</span>
<a name="l00079"></a>00079 <span class="comment">/// The physical connection between the RF22B and the Arduino require 3.3V, the 3 x SPI pins (SCK, SDI, SDO), </span>
<a name="l00080"></a>00080 <span class="comment">/// a Slave Select pin and an interrupt pin.</span>
<a name="l00081"></a>00081 <span class="comment">/// Note also that on the RFF22B, it is required to control the TX_ANT and X_ANT pins of the RFM22 in order to enable the</span>
<a name="l00082"></a>00082 <span class="comment">/// antenna connection. The RF22 library is configured so that GPIO0 and GPIO1 outputs can control TX_ANT and RX_ANT input pins</span>
<a name="l00083"></a>00083 <span class="comment">/// automatically. You must connect GPIO0 to TX_ANT and GPIO1 to RX_ANT for this automatic antenna switching to occur.</span>
<a name="l00084"></a>00084 <span class="comment">///</span>
<a name="l00085"></a>00085 <span class="comment">/// Connect the RFM-22 to most Arduino&#39;s like this (Caution, Arduino Mega has different pins for SPI, </span>
<a name="l00086"></a>00086 <span class="comment">/// see below):</span>
<a name="l00087"></a>00087 <span class="comment">/// \code</span>
<a name="l00088"></a>00088 <span class="comment">///                 Arduino      RFM-22B</span>
<a name="l00089"></a>00089 <span class="comment">///                 GND----------GND-\ (ground in)</span>
<a name="l00090"></a>00090 <span class="comment">///                              SDN-/ (shutdown in)</span>
<a name="l00091"></a>00091 <span class="comment">///                 3V3----------VCC   (3.3V in)</span>
<a name="l00092"></a>00092 <span class="comment">/// interrupt 0 pin D2-----------NIRQ  (interrupt request out)</span>
<a name="l00093"></a>00093 <span class="comment">///          SS pin D10----------NSEL  (chip select in)</span>
<a name="l00094"></a>00094 <span class="comment">///         SCK pin D13----------SCK   (SPI clock in)</span>
<a name="l00095"></a>00095 <span class="comment">///        MOSI pin D11----------SDI   (SPI Data in)</span>
<a name="l00096"></a>00096 <span class="comment">///        MISO pin D12----------SDO   (SPI data out)</span>
<a name="l00097"></a>00097 <span class="comment">///                           /--GPIO0 (GPIO0 out to control transmitter antenna TX_ANT</span>
<a name="l00098"></a>00098 <span class="comment">///                           \--TX_ANT (TX antenna control in)</span>
<a name="l00099"></a>00099 <span class="comment">///                           /--GPIO1 (GPIO1 out to control receiver antenna RX_ANT</span>
<a name="l00100"></a>00100 <span class="comment">///                           \--RX_ANT (RX antenna control in)</span>
<a name="l00101"></a>00101 <span class="comment">/// \endcode</span>
<a name="l00102"></a>00102 <span class="comment">/// For an Arduino Mega:</span>
<a name="l00103"></a>00103 <span class="comment">/// \code</span>
<a name="l00104"></a>00104 <span class="comment">///                 Mega         RFM-22B</span>
<a name="l00105"></a>00105 <span class="comment">///                 GND----------GND-\ (ground in)</span>
<a name="l00106"></a>00106 <span class="comment">///                              SDN-/ (shutdown in)</span>
<a name="l00107"></a>00107 <span class="comment">///                 3V3----------VCC   (3.3V in)</span>
<a name="l00108"></a>00108 <span class="comment">/// interrupt 0 pin D2-----------NIRQ  (interrupt request out)</span>
<a name="l00109"></a>00109 <span class="comment">///          SS pin D10----------NSEL  (chip select in)</span>
<a name="l00110"></a>00110 <span class="comment">///         SCK pin D52----------SCK   (SPI clock in)</span>
<a name="l00111"></a>00111 <span class="comment">///        MOSI pin D51----------SDI   (SPI Data in)</span>
<a name="l00112"></a>00112 <span class="comment">///        MISO pin D50----------SDO   (SPI data out)</span>
<a name="l00113"></a>00113 <span class="comment">///                           /--GPIO0 (GPIO0 out to control transmitter antenna TX_ANT</span>
<a name="l00114"></a>00114 <span class="comment">///                           \--TX_ANT (TX antenna control in)</span>
<a name="l00115"></a>00115 <span class="comment">///                           /--GPIO1 (GPIO1 out to control receiver antenna RX_ANT</span>
<a name="l00116"></a>00116 <span class="comment">///                           \--RX_ANT (RX antenna control in)</span>
<a name="l00117"></a>00117 <span class="comment">/// \endcode</span>
<a name="l00118"></a>00118 <span class="comment">/// and you can then use the default constructor RF22(). </span>
<a name="l00119"></a>00119 <span class="comment">/// You can override the default settings for the SS pin and the interrupt </span>
<a name="l00120"></a>00120 <span class="comment">/// in the RF22 constructor if you wish to connect the slave select SS to other than pin D10 </span>
<a name="l00121"></a>00121 <span class="comment">/// or the interrupt request to other than pin D2.</span>
<a name="l00122"></a>00122 <span class="comment">/// It is possible to have 2 radios conected to one arduino, provided each radio has its own </span>
<a name="l00123"></a>00123 <span class="comment">/// SS and interrupt line (SCK, SDI and SDO are common to both radios)</span>
<a name="l00124"></a>00124 <span class="comment">///</span>
<a name="l00125"></a>00125 <span class="comment">/// \par Example programs</span>
<a name="l00126"></a>00126 <span class="comment">///</span>
<a name="l00127"></a>00127 <span class="comment">/// The following example programs are provided:</span>
<a name="l00128"></a>00128 <span class="comment">/// - rf22_client, rf22_server: Simple client/server pair using RF22 class</span>
<a name="l00129"></a>00129 <span class="comment">/// - rf22_datagram_client, rf22_datagram_server: Simple client/server pair using RF22Datagram class</span>
<a name="l00130"></a>00130 <span class="comment">/// - rf22_reliable_datagram_client, rf22_reliable_datagram_server:</span>
<a name="l00131"></a>00131 <span class="comment">///   Simple client/server pair using RF22ReliableDatagram class</span>
<a name="l00132"></a>00132 <span class="comment">/// - rf22_router_client, rf22_router_server1, rf22_router_server2, rf22_router_server3: </span>
<a name="l00133"></a>00133 <span class="comment">///   Simple RF22Router network. Requires Arduino Mega.</span>
<a name="l00134"></a>00134 <span class="comment">/// - rf22_mesh_client, rf22_mesh_server1, rf22_mesh_server2, rf22_mesh_server3: </span>
<a name="l00135"></a>00135 <span class="comment">///   Simple RF22Mesh network. Requires Arduino Mega.</span>
<a name="l00136"></a>00136 <span class="comment">/// - rf22_test: Some test code used during development, shows how to call some support functions</span>
<a name="l00137"></a>00137 <span class="comment">/// - rf22_snoop: Dumps in ASCII the contents of all RF22 messages received</span>
<a name="l00138"></a>00138 <span class="comment">/// - rf22_specan: Simple spectrum analyser using the RSSI measurements of the RF22</span>
<a name="l00139"></a>00139 <span class="comment">///   (see &lt;a href=&quot;specan1.png&quot;&gt;Sample output&lt;/a&gt; showing a plot from 395.0MHz to 396.0MHz of a </span>
<a name="l00140"></a>00140 <span class="comment">///   signal generator at 395.5MHz amplitude modulated at 100% 1kHz)</span>
<a name="l00141"></a>00141 <span class="comment">///</span>
<a name="l00142"></a>00142 <span class="comment">/// \par Memory</span>
<a name="l00143"></a>00143 <span class="comment">///</span>
<a name="l00144"></a>00144 <span class="comment">/// The RF22 library requires non-trivial amounts of memory. The sample programs above all compile to </span>
<a name="l00145"></a>00145 <span class="comment">/// about 9 to 14kbytes each, which will fit in the flash proram memory of most Arduinos. However, </span>
<a name="l00146"></a>00146 <span class="comment">/// the RAM requirements are more critical. Most sample programs above will run on Duemilanova, </span>
<a name="l00147"></a>00147 <span class="comment">/// but not on Diecimila. Even on Duemilanova, the RAM requirements are very close to the </span>
<a name="l00148"></a>00148 <span class="comment">/// available memory of 2kbytes. Therefore, you should be vary sparing with RAM use in programs that use </span>
<a name="l00149"></a>00149 <span class="comment">/// the RF22 library on Duemilanova.</span>
<a name="l00150"></a>00150 <span class="comment">///</span>
<a name="l00151"></a>00151 <span class="comment">/// The sample RF22Router and RF22Mesh programs compile to about 14kbytes, </span>
<a name="l00152"></a>00152 <span class="comment">/// and require more RAM than the others. </span>
<a name="l00153"></a>00153 <span class="comment">/// They will not run on Duemilanova or Diecimila, but will run on Arduino Mega.</span>
<a name="l00154"></a>00154 <span class="comment">///</span>
<a name="l00155"></a>00155 <span class="comment">/// It is often hard to accurately identify when you are hitting RAM limits on Arduino. </span>
<a name="l00156"></a>00156 <span class="comment">/// The symptoms can include:</span>
<a name="l00157"></a>00157 <span class="comment">/// - Mysterious crashes and restarts</span>
<a name="l00158"></a>00158 <span class="comment">/// - Changes in behaviour when seemingly unrelated changes are made (such as adding print() statements)</span>
<a name="l00159"></a>00159 <span class="comment">/// - Hanging</span>
<a name="l00160"></a>00160 <span class="comment">/// - Output from Serial.print() not appearing</span>
<a name="l00161"></a>00161 <span class="comment">/// </span>
<a name="l00162"></a>00162 <span class="comment">/// With an Arduino Mega, with 8 kbytes of SRAM, there is much more RAM headroom for </span>
<a name="l00163"></a>00163 <span class="comment">/// your own elaborate programs. </span>
<a name="l00164"></a>00164 <span class="comment">/// This library is reported to work with Arduino Pro Mini, but that has not been tested by me.</span>
<a name="l00165"></a>00165 <span class="comment">///</span>
<a name="l00166"></a>00166 <span class="comment">/// The Arduino UNO is known not to work with RF22. </span>
<a name="l00167"></a>00167 <span class="comment">/// It appears that something in the Uno is interfering with MISO pin, preventing </span>
<a name="l00168"></a>00168 <span class="comment">/// the RFM initialisation completing. Miso is held at 0 when I would expect the </span>
<a name="l00169"></a>00169 <span class="comment">/// RFM22 to output data on MISO. I suspect it is the U8A USP interface chip (its </span>
<a name="l00170"></a>00170 <span class="comment">/// the only other thing connected to MISO. And if I power the Uno + RFM22 from a </span>
<a name="l00171"></a>00171 <span class="comment">/// battery instead of USB, it works fine. rubinoae reports that installing different firmware </span>
<a name="l00172"></a>00172 <span class="comment">/// in the U8A fixes this problem but that has not been tested by me.</span>
<a name="l00173"></a>00173 <span class="comment">///</span>
<a name="l00174"></a>00174 <span class="comment">/// \par Installation</span>
<a name="l00175"></a>00175 <span class="comment">///</span>
<a name="l00176"></a>00176 <span class="comment">/// Install in the usual way: unzip the distribution zip file to the libraries</span>
<a name="l00177"></a>00177 <span class="comment">/// sub-folder of your sketchbook. </span>
<a name="l00178"></a>00178 <span class="comment">///</span>
<a name="l00179"></a>00179 <span class="comment">/// This software is Copyright (C) 2011 Mike McCauley. Use is subject to license</span>
<a name="l00180"></a>00180 <span class="comment">/// conditions. The main licensing options available are GPL V2 or Commercial:</span>
<a name="l00181"></a>00181 <span class="comment">/// </span>
<a name="l00182"></a>00182 <span class="comment">/// \par Open Source Licensing GPL V2</span>
<a name="l00183"></a>00183 <span class="comment">///</span>
<a name="l00184"></a>00184 <span class="comment">/// This is the appropriate option if you want to share the source code of your</span>
<a name="l00185"></a>00185 <span class="comment">/// application with everyone you distribute it to, and you also want to give them</span>
<a name="l00186"></a>00186 <span class="comment">/// the right to share who uses it. If you wish to use this software under Open</span>
<a name="l00187"></a>00187 <span class="comment">/// Source Licensing, you must contribute all your source code to the open source</span>
<a name="l00188"></a>00188 <span class="comment">/// community in accordance with the GPL Version 2 when your application is</span>
<a name="l00189"></a>00189 <span class="comment">/// distributed. See http://www.gnu.org/copyleft/gpl.html</span>
<a name="l00190"></a>00190 <span class="comment">/// </span>
<a name="l00191"></a>00191 <span class="comment">/// \par Commercial Licensing</span>
<a name="l00192"></a>00192 <span class="comment">///</span>
<a name="l00193"></a>00193 <span class="comment">/// This is the appropriate option if you are creating proprietary applications</span>
<a name="l00194"></a>00194 <span class="comment">/// and you are not prepared to distribute and share the source code of your</span>
<a name="l00195"></a>00195 <span class="comment">/// application. Contact info@open.com.au for details.</span>
<a name="l00196"></a>00196 <span class="comment">///</span>
<a name="l00197"></a>00197 <span class="comment">/// \par Revision History</span>
<a name="l00198"></a>00198 <span class="comment">///</span>
<a name="l00199"></a>00199 <span class="comment">/// \version 1.0 Initial release</span>
<a name="l00200"></a>00200 <span class="comment">///</span>
<a name="l00201"></a>00201 <span class="comment">/// \version 1.1 Added rf22_snoop and rf22_specan examples</span>
<a name="l00202"></a>00202 <span class="comment">///</span>
<a name="l00203"></a>00203 <span class="comment">/// \version 1.2 Changed default modulation to FSK_Rb2_4Fd36</span>
<a name="l00204"></a>00204 <span class="comment">///              Some internal reorganisation.</span>
<a name="l00205"></a>00205 <span class="comment">///              Added RF22Router and RF22Mesh classes plus sample programs to support multi-hop and </span>
<a name="l00206"></a>00206 <span class="comment">///              automatic route discovery.</span>
<a name="l00207"></a>00207 <span class="comment">/// \version 1.3 Removed some unnecessary debug messages. Added virtual doArp and isPhysicalAddress</span>
<a name="l00208"></a>00208 <span class="comment">///              functions to RF22Mesh to support other physical address interpretation schemes (IPV4/IPV6?)</span>
<a name="l00209"></a>00209 <span class="comment">/// \version 1.4 RF22Router and RF22Mesh were inadvertently left out of the distro.</span>
<a name="l00210"></a>00210 <span class="comment">/// \version 1.5 Improvements contributed by Peter Mousley: Modem config table is now in flash rather than SRAM, </span>
<a name="l00211"></a>00211 <span class="comment">///              saving 400 bytes of SRAM. Allow a user-defined buffer size. Thanks Peter.</span>
<a name="l00212"></a>00212 <span class="comment">/// \version 1.6 Fixed some minor typos on doc and clarified that this code is for the RF22B. Fixed errors in the </span>
<a name="l00213"></a>00213 <span class="comment">///              definition of the power output constants which were incorrectly set to the values for the RF22.</span>
<a name="l00214"></a>00214 <span class="comment">///              Reported by Fred Slamen. If you were using a previous version of RF22, you probably were not getting the output</span>
<a name="l00215"></a>00215 <span class="comment">///              power you thought.</span>
<a name="l00216"></a>00216 <span class="comment">/// \version 1.7 Added code to initialise GPIO0 and GPIO1 so they can automatically control the TX_ANT and RX_ANT</span>
<a name="l00217"></a>00217 <span class="comment">///              antenna switching inputs. You must connect GPIO0 to TX_ANT and GPIO1 to RX_ANT for this automatic </span>
<a name="l00218"></a>00218 <span class="comment">///              antenna switching to occur. Updated doc to reflect this new connection requirement</span>
<a name="l00219"></a>00219 <span class="comment">/// \version 1.8 Changed the name of RF22_ENLBD in RF22_REG_06_INTERRUPT_ENABLE2 to RF22_ENLBDI because it collided</span>
<a name="l00220"></a>00220 <span class="comment">///              with a define of the same name in RF22_REG_07_OPERATING_MODE. RF22_REG_05_INTERRUPT_ENABLE1 enable mask</span>
<a name="l00221"></a>00221 <span class="comment">///              incorrectly used RF22_IFFERROR instead of RF22_ENFFERR. Reported by Steffan Woltjer.</span>
<a name="l00222"></a>00222 <span class="comment">/// \version 1.9 Fixed typos in RF22_REG_21_CLOCk*. Reported by Steffan Woltjer.</span>
<a name="l00223"></a>00223 <span class="comment">/// \version 1.10 Fixed a problem where a IFFERR during transmission could cause an infinite loop and a hang. </span>
<a name="l00224"></a>00224 <span class="comment">///              Reported by Raymond Gilbert.</span>
<a name="l00225"></a>00225 <span class="comment">/// \version 1.11 Fixed an innocuous typo in RF22::handleInterrupt. Reported by Zhentao.</span>
<a name="l00226"></a>00226 <span class="comment">///</span>
<a name="l00227"></a>00227 <span class="comment">/// \version 1.12 Improvements to RF22::init from Guy Molinari to improve compatibility with some </span>
<a name="l00228"></a>00228 <span class="comment">/// Arduinos. Now reported to be working with official Mega 2560 and Uno.</span>
<a name="l00229"></a>00229 <span class="comment">/// Updated so compiles on Arduino 1.0.</span>
<a name="l00230"></a>00230 <span class="comment">///</span>
<a name="l00231"></a>00231 <span class="comment">/// \version 1.13 Announce google support group</span>
<a name="l00232"></a>00232 <span class="comment">///</span>
<a name="l00233"></a>00233 <span class="comment">///</span>
<a name="l00234"></a>00234 <span class="comment">/// \author  Mike McCauley (mikem@open.com.au)</span>
<a name="l00235"></a>00235 <span class="comment"></span>
<a name="l00236"></a>00236 <span class="preprocessor">#ifndef RF22_h</span>
<a name="l00237"></a>00237 <span class="preprocessor"></span><span class="preprocessor">#define RF22_h</span>
<a name="l00238"></a>00238 <span class="preprocessor"></span>
<a name="l00239"></a>00239 <span class="preprocessor">#if ARDUINO &gt;= 100</span>
<a name="l00240"></a>00240 <span class="preprocessor"></span><span class="preprocessor">#include &lt;Arduino.h&gt;</span>
<a name="l00241"></a>00241 <span class="preprocessor">#else</span>
<a name="l00242"></a>00242 <span class="preprocessor"></span><span class="preprocessor">#include &lt;wiring.h&gt;</span>
<a name="l00243"></a>00243 <span class="preprocessor">#endif</span>
<a name="l00244"></a>00244 <span class="preprocessor"></span>
<a name="l00245"></a>00245 <span class="comment">// These defs cause trouble on some versions of Arduino</span>
<a name="l00246"></a>00246 <span class="preprocessor">#undef round</span>
<a name="l00247"></a>00247 <span class="preprocessor"></span><span class="preprocessor">#undef double</span>
<a name="l00248"></a>00248 <span class="preprocessor"></span>
<a name="l00249"></a>00249 <span class="comment">// This is the bit in the SPI address that marks it as a write</span>
<a name="l00250"></a>00250 <span class="preprocessor">#define RF22_SPI_WRITE_MASK 0x80</span>
<a name="l00251"></a>00251 <span class="preprocessor"></span>
<a name="l00252"></a>00252 <span class="comment">// This is the maximum message length that can be supported by this library. Limited by</span>
<a name="l00253"></a>00253 <span class="comment">// the message length octet in the header. Yes, 255 is correct even though the FIFO size in the RF22 is only</span>
<a name="l00254"></a>00254 <span class="comment">// 64 octets. We use interrupts to refil the Tx FIFO during transmission and to empty the</span>
<a name="l00255"></a>00255 <span class="comment">// Rx FIF during reception</span>
<a name="l00256"></a>00256 <span class="comment">// Can be pre-defined to a smaller size (to save SRAM) prior to including this header</span>
<a name="l00257"></a>00257 <span class="preprocessor">#ifndef RF22_MAX_MESSAGE_LEN</span>
<a name="l00258"></a>00258 <span class="preprocessor"></span><span class="preprocessor">#define RF22_MAX_MESSAGE_LEN 255</span>
<a name="l00259"></a>00259 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00260"></a>00260 <span class="preprocessor"></span>
<a name="l00261"></a>00261 <span class="comment">// Max number of octets the RF22 Rx and Tx FIFOs can hold</span>
<a name="l00262"></a>00262 <span class="preprocessor">#define RF22_FIFO_SIZE 64</span>
<a name="l00263"></a>00263 <span class="preprocessor"></span>
<a name="l00264"></a>00264 <span class="comment">// Keep track of the mode the RF22 is in</span>
<a name="l00265"></a>00265 <span class="preprocessor">#define RF22_MODE_IDLE         0</span>
<a name="l00266"></a>00266 <span class="preprocessor"></span><span class="preprocessor">#define RF22_MODE_RX           1</span>
<a name="l00267"></a>00267 <span class="preprocessor"></span><span class="preprocessor">#define RF22_MODE_TX           2</span>
<a name="l00268"></a>00268 <span class="preprocessor"></span>
<a name="l00269"></a>00269 <span class="comment">// These values we set for FIFO thresholds are actually the same as the POR values</span>
<a name="l00270"></a>00270 <span class="preprocessor">#define RF22_TXFFAEM_THRESHOLD 4</span>
<a name="l00271"></a>00271 <span class="preprocessor"></span><span class="preprocessor">#define RF22_RXFFAFULL_THRESHOLD 55</span>
<a name="l00272"></a>00272 <span class="preprocessor"></span>
<a name="l00273"></a>00273 <span class="comment">// This is the default node address,</span>
<a name="l00274"></a>00274 <span class="preprocessor">#define RF22_DEFAULT_NODE_ADDRESS 0</span>
<a name="l00275"></a>00275 <span class="preprocessor"></span>
<a name="l00276"></a>00276 <span class="comment">// This address in the TO addreess signifies a broadcast</span>
<a name="l00277"></a>00277 <span class="preprocessor">#define RF22_BROADCAST_ADDRESS 0xff</span>
<a name="l00278"></a>00278 <span class="preprocessor"></span>
<a name="l00279"></a>00279 <span class="comment">// Number of registers to be passed to setModemConfig()</span>
<a name="l00280"></a>00280 <span class="preprocessor">#define RF22_NUM_MODEM_CONFIG_REGS 18</span>
<a name="l00281"></a>00281 <span class="preprocessor"></span>
<a name="l00282"></a>00282 <span class="comment">// Register names</span>
<a name="l00283"></a>00283 <span class="preprocessor">#define RF22_REG_00_DEVICE_TYPE                         0x00</span>
<a name="l00284"></a>00284 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_01_VERSION_CODE                        0x01</span>
<a name="l00285"></a>00285 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_02_DEVICE_STATUS                       0x02</span>
<a name="l00286"></a>00286 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_03_INTERRUPT_STATUS1                   0x03</span>
<a name="l00287"></a>00287 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_04_INTERRUPT_STATUS2                   0x04</span>
<a name="l00288"></a>00288 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_05_INTERRUPT_ENABLE1                   0x05</span>
<a name="l00289"></a>00289 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_06_INTERRUPT_ENABLE2                   0x06</span>
<a name="l00290"></a>00290 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_07_OPERATING_MODE1                     0x07</span>
<a name="l00291"></a>00291 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_08_OPERATING_MODE2                     0x08</span>
<a name="l00292"></a>00292 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_09_OSCILLATOR_LOAD_CAPACITANCE         0x09</span>
<a name="l00293"></a>00293 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_0A_UC_OUTPUT_CLOCK                     0x0a</span>
<a name="l00294"></a>00294 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_0B_GPIO_CONFIGURATION0                 0x0b</span>
<a name="l00295"></a>00295 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_0C_GPIO_CONFIGURATION1                 0x0c</span>
<a name="l00296"></a>00296 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_0D_GPIO_CONFIGURATION2                 0x0d</span>
<a name="l00297"></a>00297 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_0E_IO_PORT_CONFIGURATION               0x0e</span>
<a name="l00298"></a>00298 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_0F_ADC_CONFIGURATION                   0x0f</span>
<a name="l00299"></a>00299 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_10_ADC_SENSOR_AMP_OFFSET               0x10</span>
<a name="l00300"></a>00300 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_11_ADC_VALUE                           0x11</span>
<a name="l00301"></a>00301 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_12_TEMPERATURE_SENSOR_CALIBRATION      0x12</span>
<a name="l00302"></a>00302 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_13_TEMPERATURE_VALUE_OFFSET            0x13</span>
<a name="l00303"></a>00303 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_14_WAKEUP_TIMER_PERIOD1                0x14</span>
<a name="l00304"></a>00304 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_15_WAKEUP_TIMER_PERIOD2                0x15</span>
<a name="l00305"></a>00305 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_16_WAKEUP_TIMER_PERIOD3                0x16</span>
<a name="l00306"></a>00306 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_17_WAKEUP_TIMER_VALUE1                 0x17</span>
<a name="l00307"></a>00307 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_18_WAKEUP_TIMER_VALUE2                 0x18</span>
<a name="l00308"></a>00308 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_19_LDC_MODE_DURATION                   0x19</span>
<a name="l00309"></a>00309 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_1A_LOW_BATTERY_DETECTOR_THRESHOLD      0x1a</span>
<a name="l00310"></a>00310 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_1B_BATTERY_VOLTAGE_LEVEL               0x1b</span>
<a name="l00311"></a>00311 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_1C_IF_FILTER_BANDWIDTH                 0x1c</span>
<a name="l00312"></a>00312 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_1D_AFC_LOOP_GEARSHIFT_OVERRIDE         0x1d</span>
<a name="l00313"></a>00313 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_1E_AFC_TIMING_CONTROL                  0x1e</span>
<a name="l00314"></a>00314 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_1F_CLOCK_RECOVERY_GEARSHIFT_OVERRIDE   0x1f</span>
<a name="l00315"></a>00315 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_20_CLOCK_RECOVERY_OVERSAMPLING_RATE    0x20</span>
<a name="l00316"></a>00316 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_21_CLOCK_RECOVERY_OFFSET2              0x21</span>
<a name="l00317"></a>00317 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_22_CLOCK_RECOVERY_OFFSET1              0x22</span>
<a name="l00318"></a>00318 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_23_CLOCK_RECOVERY_OFFSET0              0x23</span>
<a name="l00319"></a>00319 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_24_CLOCK_RECOVERY_TIMING_LOOP_GAIN1    0x24</span>
<a name="l00320"></a>00320 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_25_CLOCK_RECOVERY_TIMING_LOOP_GAIN0    0x25</span>
<a name="l00321"></a>00321 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_26_RSSI                                0x26</span>
<a name="l00322"></a>00322 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_27_RSSI_THRESHOLD                      0x27</span>
<a name="l00323"></a>00323 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_28_ANTENNA_DIVERSITY1                  0x28</span>
<a name="l00324"></a>00324 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_29_ANTENNA_DIVERSITY2                  0x29</span>
<a name="l00325"></a>00325 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_2A_AFC_LIMITER                         0x2a</span>
<a name="l00326"></a>00326 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_2B_AFC_CORRECTION_READ                 0x2b</span>
<a name="l00327"></a>00327 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_2C_OOK_COUNTER_VALUE_1                 0x2c</span>
<a name="l00328"></a>00328 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_2D_OOK_COUNTER_VALUE_2                 0x2d</span>
<a name="l00329"></a>00329 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_2E_SLICER_PEAK_HOLD                    0x2e</span>
<a name="l00330"></a>00330 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_30_DATA_ACCESS_CONTROL                 0x30</span>
<a name="l00331"></a>00331 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_31_EZMAC_STATUS                        0x31</span>
<a name="l00332"></a>00332 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_32_HEADER_CONTROL1                     0x32</span>
<a name="l00333"></a>00333 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_33_HEADER_CONTROL2                     0x33</span>
<a name="l00334"></a>00334 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_34_PREAMBLE_LENGTH                     0x34</span>
<a name="l00335"></a>00335 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_35_PREAMBLE_DETECTION_CONTROL1         0x35</span>
<a name="l00336"></a>00336 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_36_SYNC_WORD3                          0x36</span>
<a name="l00337"></a>00337 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_37_SYNC_WORD2                          0x37</span>
<a name="l00338"></a>00338 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_38_SYNC_WORD1                          0x38</span>
<a name="l00339"></a>00339 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_39_SYNC_WORD0                          0x39</span>
<a name="l00340"></a>00340 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_3A_TRANSMIT_HEADER3                    0x3a</span>
<a name="l00341"></a>00341 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_3B_TRANSMIT_HEADER2                    0x3b</span>
<a name="l00342"></a>00342 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_3C_TRANSMIT_HEADER1                    0x3c</span>
<a name="l00343"></a>00343 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_3D_TRANSMIT_HEADER0                    0x3d</span>
<a name="l00344"></a>00344 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_3E_PACKET_LENGTH                       0x3e</span>
<a name="l00345"></a>00345 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_3F_CHECK_HEADER3                       0x3f</span>
<a name="l00346"></a>00346 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_40_CHECK_HEADER2                       0x40</span>
<a name="l00347"></a>00347 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_41_CHECK_HEADER1                       0x41</span>
<a name="l00348"></a>00348 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_42_CHECK_HEADER0                       0x42</span>
<a name="l00349"></a>00349 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_43_HEADER_ENABLE3                      0x43</span>
<a name="l00350"></a>00350 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_44_HEADER_ENABLE2                      0x44</span>
<a name="l00351"></a>00351 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_45_HEADER_ENABLE1                      0x45</span>
<a name="l00352"></a>00352 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_46_HEADER_ENABLE0                      0x46</span>
<a name="l00353"></a>00353 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_47_RECEIVED_HEADER3                    0x47</span>
<a name="l00354"></a>00354 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_48_RECEIVED_HEADER2                    0x48</span>
<a name="l00355"></a>00355 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_49_RECEIVED_HEADER1                    0x49</span>
<a name="l00356"></a>00356 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_4A_RECEIVED_HEADER0                    0x4a</span>
<a name="l00357"></a>00357 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_4B_RECEIVED_PACKET_LENGTH              0x4b</span>
<a name="l00358"></a>00358 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_50_ANALOG_TEST_BUS_SELECT              0x50</span>
<a name="l00359"></a>00359 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_51_DIGITAL_TEST_BUS_SELECT             0x51</span>
<a name="l00360"></a>00360 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_52_TX_RAMP_CONTROL                     0x52</span>
<a name="l00361"></a>00361 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_53_PLL_TUNE_TIME                       0x53</span>
<a name="l00362"></a>00362 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_55_CALIBRATION_CONTROL                 0x55</span>
<a name="l00363"></a>00363 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_56_MODEM_TEST                          0x56</span>
<a name="l00364"></a>00364 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_57_CHARGE_PUMP_TEST                    0x57</span>
<a name="l00365"></a>00365 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_58_CHARGE_PUMP_CURRENT_TRIMMING        0x58</span>
<a name="l00366"></a>00366 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_59_DIVIDER_CURRENT_TRIMMING            0x59</span>
<a name="l00367"></a>00367 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_5A_VCO_CURRENT_TRIMMING                0x5a</span>
<a name="l00368"></a>00368 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_5B_VCO_CALIBRATION                     0x5b</span>
<a name="l00369"></a>00369 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_5C_SYNTHESIZER_TEST                    0x5c</span>
<a name="l00370"></a>00370 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_5D_BLOCK_ENABLE_OVERRIDE1              0x5d</span>
<a name="l00371"></a>00371 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_5E_BLOCK_ENABLE_OVERRIDE2              0x5e</span>
<a name="l00372"></a>00372 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_5F_BLOCK_ENABLE_OVERRIDE3              0x5f</span>
<a name="l00373"></a>00373 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_60_CHANNEL_FILTER_COEFFICIENT_ADDRESS  0x60</span>
<a name="l00374"></a>00374 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_61_CHANNEL_FILTER_COEFFICIENT_VALUE    0x61</span>
<a name="l00375"></a>00375 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_62_CRYSTAL_OSCILLATOR_POR_CONTROL      0x62</span>
<a name="l00376"></a>00376 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_63_RC_OSCILLATOR_COARSE_CALIBRATION    0x63</span>
<a name="l00377"></a>00377 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_64_RC_OSCILLATOR_FINE_CALIBRATION      0x64</span>
<a name="l00378"></a>00378 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_65_LDO_CONTROL_OVERRIDE                0x65</span>
<a name="l00379"></a>00379 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_66_LDO_LEVEL_SETTINGS                  0x66</span>
<a name="l00380"></a>00380 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_67_DELTA_SIGMA_ADC_TUNING1             0x67</span>
<a name="l00381"></a>00381 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_68_DELTA_SIGMA_ADC_TUNING2             0x68</span>
<a name="l00382"></a>00382 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_69_AGC_OVERRIDE1                       0x69</span>
<a name="l00383"></a>00383 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_6A_AGC_OVERRIDE2                       0x6a</span>
<a name="l00384"></a>00384 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_6B_GFSK_FIR_FILTER_COEFFICIENT_ADDRESS 0x6b</span>
<a name="l00385"></a>00385 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_6C_GFSK_FIR_FILTER_COEFFICIENT_VALUE   0x6c</span>
<a name="l00386"></a>00386 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_6D_TX_POWER                            0x6d</span>
<a name="l00387"></a>00387 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_6E_TX_DATA_RATE1                       0x6e</span>
<a name="l00388"></a>00388 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_6F_TX_DATA_RATE0                       0x6f</span>
<a name="l00389"></a>00389 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_70_MODULATION_CONTROL1                 0x70</span>
<a name="l00390"></a>00390 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_71_MODULATION_CONTROL2                 0x71</span>
<a name="l00391"></a>00391 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_72_FREQUENCY_DEVIATION                 0x72</span>
<a name="l00392"></a>00392 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_73_FREQUENCY_OFFSET1                   0x73</span>
<a name="l00393"></a>00393 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_74_FREQUENCY_OFFSET2                   0x74</span>
<a name="l00394"></a>00394 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_75_FREQUENCY_BAND_SELECT               0x75</span>
<a name="l00395"></a>00395 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_76_NOMINAL_CARRIER_FREQUENCY1          0x76</span>
<a name="l00396"></a>00396 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_77_NOMINAL_CARRIER_FREQUENCY0          0x77</span>
<a name="l00397"></a>00397 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_79_FREQUENCY_HOPPING_CHANNEL_SELECT    0x79</span>
<a name="l00398"></a>00398 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_7A_FREQUENCY_HOPPING_STEP_SIZE         0x7a</span>
<a name="l00399"></a>00399 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_7C_TX_FIFO_CONTROL1                    0x7c</span>
<a name="l00400"></a>00400 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_7D_TX_FIFO_CONTROL2                    0x7d</span>
<a name="l00401"></a>00401 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_7E_RX_FIFO_CONTROL                     0x7e</span>
<a name="l00402"></a>00402 <span class="preprocessor"></span><span class="preprocessor">#define RF22_REG_7F_FIFO_ACCESS                         0x7f</span>
<a name="l00403"></a>00403 <span class="preprocessor"></span>
<a name="l00404"></a>00404 <span class="comment">// These register masks etc are named wherever possible</span>
<a name="l00405"></a>00405 <span class="comment">// corresponding to the bit and field names in the RF-22 Manual</span>
<a name="l00406"></a>00406 <span class="comment">// RF22_REG_00_DEVICE_TYPE                      0x00</span>
<a name="l00407"></a>00407 <span class="preprocessor">#define RF22_DEVICE_TYPE_RX_TRX                 0x08</span>
<a name="l00408"></a>00408 <span class="preprocessor"></span><span class="preprocessor">#define RF22_DEVICE_TYPE_TX                     0x07</span>
<a name="l00409"></a>00409 <span class="preprocessor"></span>
<a name="l00410"></a>00410 <span class="comment">// RF22_REG_02_DEVICE_STATUS                    0x02</span>
<a name="l00411"></a>00411 <span class="preprocessor">#define RF22_FFOVL                              0x80</span>
<a name="l00412"></a>00412 <span class="preprocessor"></span><span class="preprocessor">#define RF22_FFUNFL                             0x40</span>
<a name="l00413"></a>00413 <span class="preprocessor"></span><span class="preprocessor">#define RF22_RXFFEM                             0x20</span>
<a name="l00414"></a>00414 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HEADERR                            0x10</span>
<a name="l00415"></a>00415 <span class="preprocessor"></span><span class="preprocessor">#define RF22_FREQERR                            0x08</span>
<a name="l00416"></a>00416 <span class="preprocessor"></span><span class="preprocessor">#define RF22_LOCKDET                            0x04</span>
<a name="l00417"></a>00417 <span class="preprocessor"></span><span class="preprocessor">#define RF22_CPS                                0x03</span>
<a name="l00418"></a>00418 <span class="preprocessor"></span><span class="preprocessor">#define RF22_CPS_IDLE                           0x00</span>
<a name="l00419"></a>00419 <span class="preprocessor"></span><span class="preprocessor">#define RF22_CPS_RX                             0x01</span>
<a name="l00420"></a>00420 <span class="preprocessor"></span><span class="preprocessor">#define RF22_CPS_TX                             0x10</span>
<a name="l00421"></a>00421 <span class="preprocessor"></span>
<a name="l00422"></a>00422 <span class="comment">// RF22_REG_03_INTERRUPT_STATUS1                0x03</span>
<a name="l00423"></a>00423 <span class="preprocessor">#define RF22_IFFERROR                           0x80</span>
<a name="l00424"></a>00424 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ITXFFAFULL                         0x40</span>
<a name="l00425"></a>00425 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ITXFFAEM                           0x20</span>
<a name="l00426"></a>00426 <span class="preprocessor"></span><span class="preprocessor">#define RF22_IRXFFAFULL                         0x10</span>
<a name="l00427"></a>00427 <span class="preprocessor"></span><span class="preprocessor">#define RF22_IEXT                               0x08</span>
<a name="l00428"></a>00428 <span class="preprocessor"></span><span class="preprocessor">#define RF22_IPKSENT                            0x04</span>
<a name="l00429"></a>00429 <span class="preprocessor"></span><span class="preprocessor">#define RF22_IPKVALID                           0x02</span>
<a name="l00430"></a>00430 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ICRCERROR                          0x01</span>
<a name="l00431"></a>00431 <span class="preprocessor"></span>
<a name="l00432"></a>00432 <span class="comment">// RF22_REG_04_INTERRUPT_STATUS2                0x04</span>
<a name="l00433"></a>00433 <span class="preprocessor">#define RF22_ISWDET                             0x80</span>
<a name="l00434"></a>00434 <span class="preprocessor"></span><span class="preprocessor">#define RF22_IPREAVAL                           0x40</span>
<a name="l00435"></a>00435 <span class="preprocessor"></span><span class="preprocessor">#define RF22_IPREAINVAL                         0x20</span>
<a name="l00436"></a>00436 <span class="preprocessor"></span><span class="preprocessor">#define RF22_IRSSI                              0x10</span>
<a name="l00437"></a>00437 <span class="preprocessor"></span><span class="preprocessor">#define RF22_IWUT                               0x08</span>
<a name="l00438"></a>00438 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ILBD                               0x04</span>
<a name="l00439"></a>00439 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ICHIPRDY                           0x02</span>
<a name="l00440"></a>00440 <span class="preprocessor"></span><span class="preprocessor">#define RF22_IPOR                               0x01</span>
<a name="l00441"></a>00441 <span class="preprocessor"></span>
<a name="l00442"></a>00442 <span class="comment">// RF22_REG_05_INTERRUPT_ENABLE1                0x05</span>
<a name="l00443"></a>00443 <span class="preprocessor">#define RF22_ENFFERR                            0x80</span>
<a name="l00444"></a>00444 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENTXFFAFULL                        0x40</span>
<a name="l00445"></a>00445 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENTXFFAEM                          0x20</span>
<a name="l00446"></a>00446 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENRXFFAFULL                        0x10</span>
<a name="l00447"></a>00447 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENEXT                              0x08</span>
<a name="l00448"></a>00448 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENPKSENT                           0x04</span>
<a name="l00449"></a>00449 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENPKVALID                          0x02</span>
<a name="l00450"></a>00450 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENCRCERROR                         0x01</span>
<a name="l00451"></a>00451 <span class="preprocessor"></span>
<a name="l00452"></a>00452 <span class="comment">// RF22_REG_06_INTERRUPT_ENABLE2                0x06</span>
<a name="l00453"></a>00453 <span class="preprocessor">#define RF22_ENSWDET                            0x80</span>
<a name="l00454"></a>00454 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENPREAVAL                          0x40</span>
<a name="l00455"></a>00455 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENPREAINVAL                        0x20</span>
<a name="l00456"></a>00456 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENRSSI                             0x10</span>
<a name="l00457"></a>00457 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENWUT                              0x08</span>
<a name="l00458"></a>00458 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENLBDI                             0x04</span>
<a name="l00459"></a>00459 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENCHIPRDY                          0x02</span>
<a name="l00460"></a>00460 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENPOR                              0x01</span>
<a name="l00461"></a>00461 <span class="preprocessor"></span>
<a name="l00462"></a>00462 <span class="comment">// RF22_REG_07_OPERATING_MODE                   0x07</span>
<a name="l00463"></a>00463 <span class="preprocessor">#define RF22_SWRES                              0x80</span>
<a name="l00464"></a>00464 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENLBD                              0x40</span>
<a name="l00465"></a>00465 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENWT                               0x20</span>
<a name="l00466"></a>00466 <span class="preprocessor"></span><span class="preprocessor">#define RF22_X32KSEL                            0x10</span>
<a name="l00467"></a>00467 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TXON                               0x08</span>
<a name="l00468"></a>00468 <span class="preprocessor"></span><span class="preprocessor">#define RF22_RXON                               0x04</span>
<a name="l00469"></a>00469 <span class="preprocessor"></span><span class="preprocessor">#define RF22_PLLON                              0x02</span>
<a name="l00470"></a>00470 <span class="preprocessor"></span><span class="preprocessor">#define RF22_XTON                               0x01</span>
<a name="l00471"></a>00471 <span class="preprocessor"></span>
<a name="l00472"></a>00472 <span class="comment">// RF22_REG_08_OPERATING_MODE2                  0x08</span>
<a name="l00473"></a>00473 <span class="preprocessor">#define RF22_ANTDIV                             0xc0</span>
<a name="l00474"></a>00474 <span class="preprocessor"></span><span class="preprocessor">#define RF22_RXMPK                              0x10</span>
<a name="l00475"></a>00475 <span class="preprocessor"></span><span class="preprocessor">#define RF22_AUTOTX                             0x08</span>
<a name="l00476"></a>00476 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENLDM                              0x04</span>
<a name="l00477"></a>00477 <span class="preprocessor"></span><span class="preprocessor">#define RF22_FFCLRRX                            0x02</span>
<a name="l00478"></a>00478 <span class="preprocessor"></span><span class="preprocessor">#define RF22_FFCLRTX                            0x01</span>
<a name="l00479"></a>00479 <span class="preprocessor"></span>
<a name="l00480"></a>00480 <span class="comment">// RF22_REG_0F_ADC_CONFIGURATION                0x0f</span>
<a name="l00481"></a>00481 <span class="preprocessor">#define RF22_ADCSTART                           0x80</span>
<a name="l00482"></a>00482 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCDONE                            0x80</span>
<a name="l00483"></a>00483 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCSEL                             0x70</span>
<a name="l00484"></a>00484 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCSEL_INTERNAL_TEMPERATURE_SENSOR 0x00</span>
<a name="l00485"></a>00485 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCSEL_GPIO0_SINGLE_ENDED          0x10</span>
<a name="l00486"></a>00486 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCSEL_GPIO1_SINGLE_ENDED          0x20</span>
<a name="l00487"></a>00487 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCSEL_GPIO2_SINGLE_ENDED          0x30</span>
<a name="l00488"></a>00488 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCSEL_GPIO0_GPIO1_DIFFERENTIAL    0x40</span>
<a name="l00489"></a>00489 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCSEL_GPIO1_GPIO2_DIFFERENTIAL    0x50</span>
<a name="l00490"></a>00490 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCSEL_GPIO0_GPIO2_DIFFERENTIAL    0x60</span>
<a name="l00491"></a>00491 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCSEL_GND                         0x70</span>
<a name="l00492"></a>00492 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCREF                             0x0c</span>
<a name="l00493"></a>00493 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCREF_BANDGAP_VOLTAGE             0x00</span>
<a name="l00494"></a>00494 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCREF_VDD_ON_3                    0x08</span>
<a name="l00495"></a>00495 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCREF_VDD_ON_2                    0x0c</span>
<a name="l00496"></a>00496 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ADCGAIN                            0x03</span>
<a name="l00497"></a>00497 <span class="preprocessor"></span>
<a name="l00498"></a>00498 <span class="comment">// RF22_REG_10_ADC_SENSOR_AMP_OFFSET            0x10</span>
<a name="l00499"></a>00499 <span class="preprocessor">#define RF22_ADCOFFS                            0x0f</span>
<a name="l00500"></a>00500 <span class="preprocessor"></span>
<a name="l00501"></a>00501 <span class="comment">// RF22_REG_12_TEMPERATURE_SENSOR_CALIBRATION   0x12</span>
<a name="l00502"></a>00502 <span class="preprocessor">#define RF22_TSRANGE                            0xc0</span>
<a name="l00503"></a>00503 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TSRANGE_M64_64C                    0x00</span>
<a name="l00504"></a>00504 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TSRANGE_M64_192C                   0x40</span>
<a name="l00505"></a>00505 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TSRANGE_0_128C                     0x80</span>
<a name="l00506"></a>00506 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TSRANGE_M40_216F                   0xc0</span>
<a name="l00507"></a>00507 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENTSOFFS                           0x20</span>
<a name="l00508"></a>00508 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENTSTRIM                           0x10</span>
<a name="l00509"></a>00509 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TSTRIM                             0x0f</span>
<a name="l00510"></a>00510 <span class="preprocessor"></span>
<a name="l00511"></a>00511 <span class="comment">// RF22_REG_14_WAKEUP_TIMER_PERIOD1             0x14</span>
<a name="l00512"></a>00512 <span class="preprocessor">#define RF22_WTR                                0x3c</span>
<a name="l00513"></a>00513 <span class="preprocessor"></span><span class="preprocessor">#define RF22_WTD                                0x03</span>
<a name="l00514"></a>00514 <span class="preprocessor"></span>
<a name="l00515"></a>00515 <span class="comment">// RF22_REG_30_DATA_ACCESS_CONTROL              0x30</span>
<a name="l00516"></a>00516 <span class="preprocessor">#define RF22_ENPACRX                            0x80</span>
<a name="l00517"></a>00517 <span class="preprocessor"></span><span class="preprocessor">#define RF22_LSBFRST                            0x40</span>
<a name="l00518"></a>00518 <span class="preprocessor"></span><span class="preprocessor">#define RF22_CRCDONLY                           0x20</span>
<a name="l00519"></a>00519 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENPACTX                            0x08</span>
<a name="l00520"></a>00520 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENCRC                              0x04</span>
<a name="l00521"></a>00521 <span class="preprocessor"></span><span class="preprocessor">#define RF22_CRC                                0x03</span>
<a name="l00522"></a>00522 <span class="preprocessor"></span><span class="preprocessor">#define RF22_CRC_CCITT                          0x00</span>
<a name="l00523"></a>00523 <span class="preprocessor"></span><span class="preprocessor">#define RF22_CRC_CRC_16_IBM                     0x01</span>
<a name="l00524"></a>00524 <span class="preprocessor"></span><span class="preprocessor">#define RF22_CRC_IEC_16                         0x02</span>
<a name="l00525"></a>00525 <span class="preprocessor"></span><span class="preprocessor">#define RF22_CRC_BIACHEVA                       0x03</span>
<a name="l00526"></a>00526 <span class="preprocessor"></span>
<a name="l00527"></a>00527 <span class="comment">// RF22_REG_32_HEADER_CONTROL1                  0x32</span>
<a name="l00528"></a>00528 <span class="preprocessor">#define RF22_BCEN                               0xf0</span>
<a name="l00529"></a>00529 <span class="preprocessor"></span><span class="preprocessor">#define RF22_BCEN_NONE                          0x00</span>
<a name="l00530"></a>00530 <span class="preprocessor"></span><span class="preprocessor">#define RF22_BCEN_HEADER0                       0x10</span>
<a name="l00531"></a>00531 <span class="preprocessor"></span><span class="preprocessor">#define RF22_BCEN_HEADER1                       0x20</span>
<a name="l00532"></a>00532 <span class="preprocessor"></span><span class="preprocessor">#define RF22_BCEN_HEADER2                       0x40</span>
<a name="l00533"></a>00533 <span class="preprocessor"></span><span class="preprocessor">#define RF22_BCEN_HEADER3                       0x80</span>
<a name="l00534"></a>00534 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDCH                               0x0f</span>
<a name="l00535"></a>00535 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDCH_NONE                          0x00</span>
<a name="l00536"></a>00536 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDCH_HEADER0                       0x01</span>
<a name="l00537"></a>00537 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDCH_HEADER1                       0x02</span>
<a name="l00538"></a>00538 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDCH_HEADER2                       0x04</span>
<a name="l00539"></a>00539 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDCH_HEADER3                       0x08</span>
<a name="l00540"></a>00540 <span class="preprocessor"></span>
<a name="l00541"></a>00541 <span class="comment">// RF22_REG_33_HEADER_CONTROL2                  0x33</span>
<a name="l00542"></a>00542 <span class="preprocessor">#define RF22_HDLEN                              0x70</span>
<a name="l00543"></a>00543 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDLEN_0                            0x00</span>
<a name="l00544"></a>00544 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDLEN_1                            0x10</span>
<a name="l00545"></a>00545 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDLEN_2                            0x20</span>
<a name="l00546"></a>00546 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDLEN_3                            0x30</span>
<a name="l00547"></a>00547 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HDLEN_4                            0x40</span>
<a name="l00548"></a>00548 <span class="preprocessor"></span><span class="preprocessor">#define RF22_FIXPKLEN                           0x08</span>
<a name="l00549"></a>00549 <span class="preprocessor"></span><span class="preprocessor">#define RF22_SYNCLEN                            0x06</span>
<a name="l00550"></a>00550 <span class="preprocessor"></span><span class="preprocessor">#define RF22_SYNCLEN_1                          0x00</span>
<a name="l00551"></a>00551 <span class="preprocessor"></span><span class="preprocessor">#define RF22_SYNCLEN_2                          0x02</span>
<a name="l00552"></a>00552 <span class="preprocessor"></span><span class="preprocessor">#define RF22_SYNCLEN_3                          0x04</span>
<a name="l00553"></a>00553 <span class="preprocessor"></span><span class="preprocessor">#define RF22_SYNCLEN_4                          0x06</span>
<a name="l00554"></a>00554 <span class="preprocessor"></span><span class="preprocessor">#define RF22_PREALEN8                           0x01</span>
<a name="l00555"></a>00555 <span class="preprocessor"></span>
<a name="l00556"></a>00556 <span class="comment">// RF22_REG_6D_TX_POWER                         0x6d</span>
<a name="l00557"></a>00557 <span class="preprocessor">#define RF22_TXPOW                              0x07</span>
<a name="l00558"></a>00558 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TXPOW_4X31                         0x08 // Not used in RFM22B</span>
<a name="l00559"></a>00559 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TXPOW_1DBM                         0x00</span>
<a name="l00560"></a>00560 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TXPOW_2DBM                         0x01</span>
<a name="l00561"></a>00561 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TXPOW_5DBM                         0x02</span>
<a name="l00562"></a>00562 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TXPOW_8DBM                         0x03</span>
<a name="l00563"></a>00563 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TXPOW_11DBM                        0x04</span>
<a name="l00564"></a>00564 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TXPOW_14DBM                        0x05</span>
<a name="l00565"></a>00565 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TXPOW_17DBM                        0x06</span>
<a name="l00566"></a>00566 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TXPOW_20DBM                        0x07</span>
<a name="l00567"></a>00567 <span class="preprocessor"></span><span class="comment">// IN RFM23B</span>
<a name="l00568"></a>00568 <span class="preprocessor">#define RF22_TXPOW_LNA_SW                       0x08</span>
<a name="l00569"></a>00569 <span class="preprocessor"></span>
<a name="l00570"></a>00570 <span class="comment">// RF22_REG_71_MODULATION_CONTROL2              0x71</span>
<a name="l00571"></a>00571 <span class="preprocessor">#define RF22_TRCLK                              0xc0</span>
<a name="l00572"></a>00572 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TRCLK_NONE                         0x00</span>
<a name="l00573"></a>00573 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TRCLK_GPIO                         0x40</span>
<a name="l00574"></a>00574 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TRCLK_SDO                          0x80</span>
<a name="l00575"></a>00575 <span class="preprocessor"></span><span class="preprocessor">#define RF22_TRCLK_NIRQ                         0xc0</span>
<a name="l00576"></a>00576 <span class="preprocessor"></span><span class="preprocessor">#define RF22_DTMOD                              0x30</span>
<a name="l00577"></a>00577 <span class="preprocessor"></span><span class="preprocessor">#define RF22_DTMOD_DIRECT_GPIO                  0x00</span>
<a name="l00578"></a>00578 <span class="preprocessor"></span><span class="preprocessor">#define RF22_DTMOD_DIRECT_SDI                   0x10</span>
<a name="l00579"></a>00579 <span class="preprocessor"></span><span class="preprocessor">#define RF22_DTMOD_FIFO                         0x20</span>
<a name="l00580"></a>00580 <span class="preprocessor"></span><span class="preprocessor">#define RF22_DTMOD_PN9                          0x30</span>
<a name="l00581"></a>00581 <span class="preprocessor"></span><span class="preprocessor">#define RF22_ENINV                              0x08</span>
<a name="l00582"></a>00582 <span class="preprocessor"></span><span class="preprocessor">#define RF22_FD8                                0x04</span>
<a name="l00583"></a>00583 <span class="preprocessor"></span><span class="preprocessor">#define RF22_MODTYP                             0x30</span>
<a name="l00584"></a>00584 <span class="preprocessor"></span><span class="preprocessor">#define RF22_MODTYP_UNMODULATED                 0x00</span>
<a name="l00585"></a>00585 <span class="preprocessor"></span><span class="preprocessor">#define RF22_MODTYP_OOK                         0x01</span>
<a name="l00586"></a>00586 <span class="preprocessor"></span><span class="preprocessor">#define RF22_MODTYP_FSK                         0x02</span>
<a name="l00587"></a>00587 <span class="preprocessor"></span><span class="preprocessor">#define RF22_MODTYP_GFSK                        0x03</span>
<a name="l00588"></a>00588 <span class="preprocessor"></span>
<a name="l00589"></a>00589 <span class="comment">// RF22_REG_75_FREQUENCY_BAND_SELECT            0x75</span>
<a name="l00590"></a>00590 <span class="preprocessor">#define RF22_SBSEL                              0x40</span>
<a name="l00591"></a>00591 <span class="preprocessor"></span><span class="preprocessor">#define RF22_HBSEL                              0x20</span>
<a name="l00592"></a>00592 <span class="preprocessor"></span><span class="preprocessor">#define RF22_FB                                 0x1f</span>
<a name="l00593"></a>00593 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00594"></a>00594 <span class="comment">/////////////////////////////////////////////////////////////////////</span>
<a name="l00595"></a>00595 <span class="comment">/// \class RF22 RF22.h &lt;RF22.h&gt;</span>
<a name="l00596"></a>00596 <span class="comment">/// \brief Send and receive unaddressed, unreliable datagrams.</span>
<a name="l00597"></a>00597 <span class="comment">///</span>
<a name="l00598"></a>00598 <span class="comment">/// This base class provides basic functions for sending and receiving unaddressed, </span>
<a name="l00599"></a>00599 <span class="comment">/// unreliable datagrams of arbitrary length to 255 octets per packet.</span>
<a name="l00600"></a>00600 <span class="comment">///</span>
<a name="l00601"></a>00601 <span class="comment">/// Subclasses may use this class to implement reliable, addressed datagrams and streams, </span>
<a name="l00602"></a>00602 <span class="comment">/// mesh routers, repeaters, translators etc.</span>
<a name="l00603"></a>00603 <span class="comment">///</span>
<a name="l00604"></a>00604 <span class="comment">/// On transmission, the TO and FROM addresses default to 0x00, unless changed by a subclass. </span>
<a name="l00605"></a>00605 <span class="comment">/// On reception the TO addressed is checked against the node address (defaults to 0x00) or the</span>
<a name="l00606"></a>00606 <span class="comment">/// broadcast address (which is 0xff). The ID and FLAGS are set to 0, and not checked by this class.</span>
<a name="l00607"></a>00607 <span class="comment">/// This permits use of the this base RF22 class as an </span>
<a name="l00608"></a>00608 <span class="comment">/// unaddresed, unreliable datagram service. Subclasses are expected to change this behaviour to </span>
<a name="l00609"></a>00609 <span class="comment">/// add node address, ids, retransmission etc</span>
<a name="l00610"></a>00610 <span class="comment">///</span>
<a name="l00611"></a>00611 <span class="comment">/// Naturally, for any 2 radios to communicate that must be configured to use the same frequence and </span>
<a name="l00612"></a>00612 <span class="comment">/// modulation scheme.</span>
<a name="l00613"></a><a class="code" href="classRF22.html">00613</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classRF22.html" title="Send and receive unaddressed, unreliable datagrams.">RF22</a>
<a name="l00614"></a>00614 {
<a name="l00615"></a>00615 <span class="keyword">public</span>:
<a name="l00616"></a>00616 <span class="comment"></span>
<a name="l00617"></a>00617 <span class="comment">    /// \brief Defines register values for a set of modem configuration registers</span>
<a name="l00618"></a>00618 <span class="comment">    ///</span>
<a name="l00619"></a>00619 <span class="comment">    /// Defines register values for a set of modem configuration registers</span>
<a name="l00620"></a>00620 <span class="comment">    /// that can be passed to setModemConfig()</span>
<a name="l00621"></a>00621 <span class="comment">    /// if none of the choices in ModemConfigChoice suit your need</span>
<a name="l00622"></a>00622 <span class="comment">    /// setModemConfig() writes the register values to the appropriate RF22 registers</span>
<a name="l00623"></a>00623 <span class="comment">    /// to set the desired modulation type, data rate and deviation/bandwidth.</span>
<a name="l00624"></a>00624 <span class="comment">    /// Suitable values for these registers can be computed using the register calculator at</span>
<a name="l00625"></a>00625 <span class="comment">    /// &quot;http://www.hoperf.com/upfile/RF22B 23B 31B 42B 43B Register Settings_RevB1-v5.xls&quot;</span>
<a name="l00626"></a><a class="code" href="structRF22_1_1ModemConfig.html">00626</a> <span class="comment"></span>    <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00627"></a>00627     {
<a name="l00628"></a><a class="code" href="structRF22_1_1ModemConfig.html#aae1023d3cf1ca383337b6885be9ad0e4">00628</a>         uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#aae1023d3cf1ca383337b6885be9ad0e4" title="Value for register RF22_REG_1C_IF_FILTER_BANDWIDTH.">reg_1c</a>;   <span class="comment">///&lt; Value for register RF22_REG_1C_IF_FILTER_BANDWIDTH</span>
<a name="l00629"></a><a class="code" href="structRF22_1_1ModemConfig.html#aabe5ed0b26be68a7b2ce101f51f8321e">00629</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#aabe5ed0b26be68a7b2ce101f51f8321e" title="Value for register RF22_REG_1F_CLOCK_RECOVERY_GEARSHIFT_OVERRIDE.">reg_1f</a>;   <span class="comment">///&lt; Value for register RF22_REG_1F_CLOCK_RECOVERY_GEARSHIFT_OVERRIDE</span>
<a name="l00630"></a><a class="code" href="structRF22_1_1ModemConfig.html#a4c83bcce043116762e8b95e39efafc15">00630</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a4c83bcce043116762e8b95e39efafc15" title="Value for register RF22_REG_20_CLOCK_RECOVERY_OVERSAMPLING_RATE.">reg_20</a>;   <span class="comment">///&lt; Value for register RF22_REG_20_CLOCK_RECOVERY_OVERSAMPLING_RATE</span>
<a name="l00631"></a><a class="code" href="structRF22_1_1ModemConfig.html#a8b549c188f1b06939b03f45163600d06">00631</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a8b549c188f1b06939b03f45163600d06" title="Value for register RF22_REG_21_CLOCK_RECOVERY_OFFSET2.">reg_21</a>;   <span class="comment">///&lt; Value for register RF22_REG_21_CLOCK_RECOVERY_OFFSET2 </span>
<a name="l00632"></a><a class="code" href="structRF22_1_1ModemConfig.html#a8177dece4c138d04bb5af54d8b162549">00632</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a8177dece4c138d04bb5af54d8b162549" title="Value for register RF22_REG_22_CLOCK_RECOVERY_OFFSET1.">reg_22</a>;   <span class="comment">///&lt; Value for register RF22_REG_22_CLOCK_RECOVERY_OFFSET1 </span>
<a name="l00633"></a><a class="code" href="structRF22_1_1ModemConfig.html#a3570f3c67926de500ef3f5825c2412c9">00633</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a3570f3c67926de500ef3f5825c2412c9" title="Value for register RF22_REG_23_CLOCK_RECOVERY_OFFSET0.">reg_23</a>;   <span class="comment">///&lt; Value for register RF22_REG_23_CLOCK_RECOVERY_OFFSET0</span>
<a name="l00634"></a><a class="code" href="structRF22_1_1ModemConfig.html#afa054b92cf2170cda2a5eb1e0d148387">00634</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#afa054b92cf2170cda2a5eb1e0d148387" title="Value for register RF22_REG_24_CLOCK_RECOVERY_TIMING_LOOP_GAIN1.">reg_24</a>;   <span class="comment">///&lt; Value for register RF22_REG_24_CLOCK_RECOVERY_TIMING_LOOP_GAIN1</span>
<a name="l00635"></a><a class="code" href="structRF22_1_1ModemConfig.html#ab237707e28555af58fbdf8869c75a4f8">00635</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#ab237707e28555af58fbdf8869c75a4f8" title="Value for register RF22_REG_25_CLOCK_RECOVERY_TIMING_LOOP_GAIN0.">reg_25</a>;   <span class="comment">///&lt; Value for register RF22_REG_25_CLOCK_RECOVERY_TIMING_LOOP_GAIN0 </span>
<a name="l00636"></a><a class="code" href="structRF22_1_1ModemConfig.html#ab9ed392cf2970e4e20339452a0777776">00636</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#ab9ed392cf2970e4e20339452a0777776" title="Value for register RF22_REG_2C_OOK_COUNTER_VALUE_1.">reg_2c</a>;   <span class="comment">///&lt; Value for register RF22_REG_2C_OOK_COUNTER_VALUE_1 </span>
<a name="l00637"></a><a class="code" href="structRF22_1_1ModemConfig.html#a241f0881b1a97f24b5df28069e3c4ef5">00637</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a241f0881b1a97f24b5df28069e3c4ef5" title="Value for register RF22_REG_2D_OOK_COUNTER_VALUE_2.">reg_2d</a>;   <span class="comment">///&lt; Value for register RF22_REG_2D_OOK_COUNTER_VALUE_2</span>
<a name="l00638"></a><a class="code" href="structRF22_1_1ModemConfig.html#afb8c782b97aac787861c02831a07d421">00638</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#afb8c782b97aac787861c02831a07d421" title="Value for register RF22_REG_2E_SLICER_PEAK_HOLD.">reg_2e</a>;   <span class="comment">///&lt; Value for register RF22_REG_2E_SLICER_PEAK_HOLD </span>
<a name="l00639"></a><a class="code" href="structRF22_1_1ModemConfig.html#a94143268bf426df086d05728eb0c4fd2">00639</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a94143268bf426df086d05728eb0c4fd2" title="Value for register RF22_REG_58_CHARGE_PUMP_CURRENT_TRIMMING.">reg_58</a>;   <span class="comment">///&lt; Value for register RF22_REG_58_CHARGE_PUMP_CURRENT_TRIMMING</span>
<a name="l00640"></a><a class="code" href="structRF22_1_1ModemConfig.html#a97b3d513345371a58b5a72984f0f0309">00640</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a97b3d513345371a58b5a72984f0f0309" title="Value for register RF22_REG_69_AGC_OVERRIDE1.">reg_69</a>;   <span class="comment">///&lt; Value for register RF22_REG_69_AGC_OVERRIDE1 </span>
<a name="l00641"></a><a class="code" href="structRF22_1_1ModemConfig.html#a412f4211bc08826afcd89b72cb6229ff">00641</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a412f4211bc08826afcd89b72cb6229ff" title="Value for register RF22_REG_6E_TX_DATA_RATE1.">reg_6e</a>;   <span class="comment">///&lt; Value for register RF22_REG_6E_TX_DATA_RATE1</span>
<a name="l00642"></a><a class="code" href="structRF22_1_1ModemConfig.html#a31dfc3c71ec90a3d6a52d1eb00a42244">00642</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a31dfc3c71ec90a3d6a52d1eb00a42244" title="Value for register RF22_REG_6F_TX_DATA_RATE0.">reg_6f</a>;   <span class="comment">///&lt; Value for register RF22_REG_6F_TX_DATA_RATE0 </span>
<a name="l00643"></a><a class="code" href="structRF22_1_1ModemConfig.html#a8256681d03d741a6d073c545eda4762a">00643</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a8256681d03d741a6d073c545eda4762a" title="Value for register RF22_REG_70_MODULATION_CONTROL1.">reg_70</a>;   <span class="comment">///&lt; Value for register RF22_REG_70_MODULATION_CONTROL1</span>
<a name="l00644"></a><a class="code" href="structRF22_1_1ModemConfig.html#a71f169501bbb043d417fcae11cddf85a">00644</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#a71f169501bbb043d417fcae11cddf85a" title="Value for register RF22_REG_71_MODULATION_CONTROL2.">reg_71</a>;   <span class="comment">///&lt; Value for register RF22_REG_71_MODULATION_CONTROL2</span>
<a name="l00645"></a><a class="code" href="structRF22_1_1ModemConfig.html#ae198bb2f0feba4abb1f5885636a69072">00645</a> <span class="comment"></span>        uint8_t    <a class="code" href="structRF22_1_1ModemConfig.html#ae198bb2f0feba4abb1f5885636a69072" title="Value for register RF22_REG_72_FREQUENCY_DEVIATION.">reg_72</a>;   <span class="comment">///&lt; Value for register RF22_REG_72_FREQUENCY_DEVIATION</span>
<a name="l00646"></a>00646 <span class="comment"></span>    } <a class="code" href="structRF22_1_1ModemConfig.html" title="Defines register values for a set of modem configuration registers.">ModemConfig</a>;
<a name="l00647"></a>00647   <span class="comment"></span>
<a name="l00648"></a>00648 <span class="comment">    /// Choices for setModemConfig() for a selected subset of common modulation types,</span>
<a name="l00649"></a>00649 <span class="comment">    /// and data rates. If you need another configuration, use the register calculator at</span>
<a name="l00650"></a>00650 <span class="comment">    /// &quot;http://www.hoperf.com/upfile/RF22B 23B 31B 42B 43B Register Settings_RevB1-v5.xls&quot;</span>
<a name="l00651"></a>00651 <span class="comment">    /// and call setModemRegisters() with your desired settings</span>
<a name="l00652"></a>00652 <span class="comment">    /// These are indexes into _modemConfig</span>
<a name="l00653"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1">00653</a> <span class="comment"></span>    <span class="keyword">typedef</span> <span class="keyword">enum</span>
<a name="l00654"></a>00654     {
<a name="l00655"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ac7e1fdd5ade4bcf659565eae235e1ad2">00655</a>         <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ac7e1fdd5ade4bcf659565eae235e1ad2" title="Unmodulated carrier for testing.">UnmodulatedCarrier</a> = 0, <span class="comment">///&lt; Unmodulated carrier for testing</span>
<a name="l00656"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a57cad597472646c4dc4cb85aa7c9cbe9">00656</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a57cad597472646c4dc4cb85aa7c9cbe9" title="FSK, No Manchester, Rb = 2kbs, Fd = 5kHz, PN9 random modulation for testing.">FSK_PN9_Rb2Fd5</a>,      <span class="comment">///&lt; FSK, No Manchester, Rb = 2kbs, Fd = 5kHz, PN9 random modulation for testing</span>
<a name="l00657"></a>00657 <span class="comment"></span>
<a name="l00658"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ab706c642e0b7242e0685c42babb0ef7b">00658</a>         <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ab706c642e0b7242e0685c42babb0ef7b" title="FSK, No Manchester, Rb = 2kbs, Fd = 5kHz.">FSK_Rb2Fd5</a>,          <span class="comment">///&lt; FSK, No Manchester, Rb = 2kbs,    Fd = 5kHz</span>
<a name="l00659"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ab78263478bc47e320e3e14184310bdb1">00659</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ab78263478bc47e320e3e14184310bdb1" title="FSK, No Manchester, Rb = 2.4kbs, Fd = 36kHz.">FSK_Rb2_4Fd36</a>,       <span class="comment">///&lt; FSK, No Manchester, Rb = 2.4kbs,  Fd = 36kHz</span>
<a name="l00660"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a140ea7219f2b3c8a034347702e384a36">00660</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a140ea7219f2b3c8a034347702e384a36" title="FSK, No Manchester, Rb = 4.8kbs, Fd = 45kHz.">FSK_Rb4_8Fd45</a>,       <span class="comment">///&lt; FSK, No Manchester, Rb = 4.8kbs,  Fd = 45kHz</span>
<a name="l00661"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a2d893806d31eccebdfef6cf7f89f1257">00661</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a2d893806d31eccebdfef6cf7f89f1257" title="FSK, No Manchester, Rb = 9.6kbs, Fd = 45kHz.">FSK_Rb9_6Fd45</a>,       <span class="comment">///&lt; FSK, No Manchester, Rb = 9.6kbs,  Fd = 45kHz</span>
<a name="l00662"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ae0a4dcc0c46f1d354285f3079cba782c">00662</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ae0a4dcc0c46f1d354285f3079cba782c" title="FSK, No Manchester, Rb = 19.2kbs, Fd = 9.6kHz.">FSK_Rb19_2Fd9_6</a>,     <span class="comment">///&lt; FSK, No Manchester, Rb = 19.2kbs, Fd = 9.6kHz</span>
<a name="l00663"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a7021c80e3a94842e44e35d87a2befa62">00663</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a7021c80e3a94842e44e35d87a2befa62" title="FSK, No Manchester, Rb = 38.4kbs, Fd = 19.6kHz.">FSK_Rb38_4Fd19_6</a>,    <span class="comment">///&lt; FSK, No Manchester, Rb = 38.4kbs, Fd = 19.6kHz</span>
<a name="l00664"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a6ada70eaab5a4e3f4d5a0954d4a0631a">00664</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a6ada70eaab5a4e3f4d5a0954d4a0631a" title="FSK, No Manchester, Rb = 57.6kbs, Fd = 28.8kHz.">FSK_Rb57_6Fd28_8</a>,    <span class="comment">///&lt; FSK, No Manchester, Rb = 57.6kbs, Fd = 28.8kHz</span>
<a name="l00665"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a13a03a8009dc81941f93b924c01d2811">00665</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a13a03a8009dc81941f93b924c01d2811" title="FSK, No Manchester, Rb = 125kbs, Fd = 125kHz.">FSK_Rb125Fd125</a>,      <span class="comment">///&lt; FSK, No Manchester, Rb = 125kbs,  Fd = 125kHz</span>
<a name="l00666"></a>00666 <span class="comment"></span>
<a name="l00667"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a156fcbf8d375d6a2f8bbb46824aca430">00667</a>         <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a156fcbf8d375d6a2f8bbb46824aca430" title="GFSK, No Manchester, Rb = 2kbs, Fd = 5kHz.">GFSK_Rb2Fd5</a>,         <span class="comment">///&lt; GFSK, No Manchester, Rb = 2kbs,    Fd = 5kHz</span>
<a name="l00668"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a5af02fa49297aa13b0efc8306c3c10aa">00668</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a5af02fa49297aa13b0efc8306c3c10aa" title="GFSK, No Manchester, Rb = 2.4kbs, Fd = 36kHz.">GFSK_Rb2_4Fd36</a>,      <span class="comment">///&lt; GFSK, No Manchester, Rb = 2.4kbs,  Fd = 36kHz</span>
<a name="l00669"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ad9afd09e7ea98e1d15be0f7470f9b721">00669</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ad9afd09e7ea98e1d15be0f7470f9b721" title="GFSK, No Manchester, Rb = 4.8kbs, Fd = 45kHz.">GFSK_Rb4_8Fd45</a>,      <span class="comment">///&lt; GFSK, No Manchester, Rb = 4.8kbs,  Fd = 45kHz</span>
<a name="l00670"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ab84a580ab517faa1221cc166dcbc331a">00670</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ab84a580ab517faa1221cc166dcbc331a" title="GFSK, No Manchester, Rb = 9.6kbs, Fd = 45kHz.">GFSK_Rb9_6Fd45</a>,      <span class="comment">///&lt; GFSK, No Manchester, Rb = 9.6kbs,  Fd = 45kHz</span>
<a name="l00671"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ac4558752ce6bab0f01cda50c5cc31423">00671</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ac4558752ce6bab0f01cda50c5cc31423" title="GFSK, No Manchester, Rb = 19.2kbs, Fd = 9.6kHz.">GFSK_Rb19_2Fd9_6</a>,    <span class="comment">///&lt; GFSK, No Manchester, Rb = 19.2kbs, Fd = 9.6kHz</span>
<a name="l00672"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a8f7c5a5c02f46e5bba221d9bab276810">00672</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a8f7c5a5c02f46e5bba221d9bab276810" title="GFSK, No Manchester, Rb = 38.4kbs, Fd = 19.6kHz.">GFSK_Rb38_4Fd19_6</a>,   <span class="comment">///&lt; GFSK, No Manchester, Rb = 38.4kbs, Fd = 19.6kHz</span>
<a name="l00673"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a93957ac322afdae70620bc5a592468b7">00673</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a93957ac322afdae70620bc5a592468b7" title="GFSK, No Manchester, Rb = 57.6kbs, Fd = 28.8kHz.">GFSK_Rb57_6Fd28_8</a>,   <span class="comment">///&lt; GFSK, No Manchester, Rb = 57.6kbs, Fd = 28.8kHz</span>
<a name="l00674"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ae77ddcf9d0f51b0e9731e00dfcaebc20">00674</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ae77ddcf9d0f51b0e9731e00dfcaebc20" title="GFSK, No Manchester, Rb = 125kbs, Fd = 125kHz.">GFSK_Rb125Fd125</a>,     <span class="comment">///&lt; GFSK, No Manchester, Rb = 125kbs,  Fd = 125kHz</span>
<a name="l00675"></a>00675 <span class="comment"></span>
<a name="l00676"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1af3a09faaa284b438b3d4da9fc6058aa4">00676</a>         <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1af3a09faaa284b438b3d4da9fc6058aa4" title="OOK, No Manchester, Rb = 1.2kbs, Rx Bandwidth = 75kHz.">OOK_Rb1_2Bw75</a>,       <span class="comment">///&lt; OOK, No Manchester, Rb = 1.2kbs,  Rx Bandwidth = 75kHz</span>
<a name="l00677"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a60e4b4348d0c08ada8b111f574e2a308">00677</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a60e4b4348d0c08ada8b111f574e2a308" title="OOK, No Manchester, Rb = 2.4kbs, Rx Bandwidth = 335kHz.">OOK_Rb2_4Bw335</a>,      <span class="comment">///&lt; OOK, No Manchester, Rb = 2.4kbs,  Rx Bandwidth = 335kHz</span>
<a name="l00678"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a57fa115fb0aa210bbcf6cf6387eac7b0">00678</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a57fa115fb0aa210bbcf6cf6387eac7b0" title="OOK, No Manchester, Rb = 4.8kbs, Rx Bandwidth = 335kHz.">OOK_Rb4_8Bw335</a>,      <span class="comment">///&lt; OOK, No Manchester, Rb = 4.8kbs,  Rx Bandwidth = 335kHz</span>
<a name="l00679"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ab3f929c9c8da2c05dbdbb0439a4e2c7a">00679</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1ab3f929c9c8da2c05dbdbb0439a4e2c7a" title="OOK, No Manchester, Rb = 9.6kbs, Rx Bandwidth = 335kHz.">OOK_Rb9_6Bw335</a>,      <span class="comment">///&lt; OOK, No Manchester, Rb = 9.6kbs,  Rx Bandwidth = 335kHz</span>
<a name="l00680"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a106af5c9d04c9edcd00b6e89c3345cb8">00680</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a106af5c9d04c9edcd00b6e89c3345cb8" title="OOK, No Manchester, Rb = 19.2kbs, Rx Bandwidth = 335kHz.">OOK_Rb19_2Bw335</a>,     <span class="comment">///&lt; OOK, No Manchester, Rb = 19.2kbs, Rx Bandwidth = 335kHz</span>
<a name="l00681"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1af0bafb7fdc78209640c3c715626baa07">00681</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1af0bafb7fdc78209640c3c715626baa07" title="OOK, No Manchester, Rb = 38.4kbs, Rx Bandwidth = 335kHz.">OOK_Rb38_4Bw335</a>,     <span class="comment">///&lt; OOK, No Manchester, Rb = 38.4kbs, Rx Bandwidth = 335kHz</span>
<a name="l00682"></a><a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a8bef88fd6beaa3fd3696baa5cad272c5">00682</a> <span class="comment"></span>        <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1a8bef88fd6beaa3fd3696baa5cad272c5" title="OOK, No Manchester, Rb = 40kbs, Rx Bandwidth = 335kHz.">OOK_Rb40Bw335</a>        <span class="comment">///&lt; OOK, No Manchester, Rb = 40kbs,   Rx Bandwidth = 335kHz</span>
<a name="l00683"></a>00683 <span class="comment"></span>    } <a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1">ModemConfigChoice</a>;
<a name="l00684"></a>00684 <span class="comment"></span>
<a name="l00685"></a>00685 <span class="comment">    /// Constructor. You can have multiple instances, but each instance must have its own</span>
<a name="l00686"></a>00686 <span class="comment">    /// interrupt and slave select pin. After constructing, you must call init() to initialise the intnerface</span>
<a name="l00687"></a>00687 <span class="comment">    /// and the radio module</span>
<a name="l00688"></a>00688 <span class="comment">    /// \param[in] slaveSelectPin the Arduino pin number of the output to use to select the RF22 before</span>
<a name="l00689"></a>00689 <span class="comment">    /// accessing it</span>
<a name="l00690"></a>00690 <span class="comment">    /// \param[in] interrupt The interrupt number to use. Default is interrupt 0 (Arduino input pin 2)</span>
<a name="l00691"></a>00691 <span class="comment"></span>    <a class="code" href="classRF22.html#aadb6f0983a830b4608948d110b8a5ed9">RF22</a>(uint8_t slaveSelectPin = 10, uint8_t interrupt = 0);
<a name="l00692"></a>00692   <span class="comment"></span>
<a name="l00693"></a>00693 <span class="comment">    /// Initialises this instance and the radio module connected to it.</span>
<a name="l00694"></a>00694 <span class="comment">    /// The following steps are taken:</span>
<a name="l00695"></a>00695 <span class="comment">    /// - Initialise the slave select pin and the SPI interface library</span>
<a name="l00696"></a>00696 <span class="comment">    /// - Software reset the RF22 module</span>
<a name="l00697"></a>00697 <span class="comment">    /// - Checks the connected RF22 module is either a RF22_DEVICE_TYPE_RX_TRX or a RF22_DEVICE_TYPE_TX</span>
<a name="l00698"></a>00698 <span class="comment">    /// - Attaches an interrupt handler</span>
<a name="l00699"></a>00699 <span class="comment">    /// - Configures the RF22 module</span>
<a name="l00700"></a>00700 <span class="comment">    /// - Sets the frequncy to 434.0 MHz</span>
<a name="l00701"></a>00701 <span class="comment">    /// - Sets the modem data rate to FSK_Rb2_4Fd36</span>
<a name="l00702"></a>00702 <span class="comment">    /// \return  true if everything was successful</span>
<a name="l00703"></a>00703 <span class="comment"></span>    <span class="keywordtype">boolean</span>        <a class="code" href="classRF22.html#ac211ed2b29be32088714b4bfa1ebbe4c">init</a>();
<a name="l00704"></a>00704 <span class="comment"></span>
<a name="l00705"></a>00705 <span class="comment">    /// Issues a software reset to the </span>
<a name="l00706"></a>00706 <span class="comment">    /// RF22 module. Blocks for 1ms to ensure the reset is complete.</span>
<a name="l00707"></a>00707 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a1c572667477ef36daeae01c52f553e5b">reset</a>();
<a name="l00708"></a>00708 <span class="comment"></span>
<a name="l00709"></a>00709 <span class="comment">    /// Reads a single register from the RF22</span>
<a name="l00710"></a>00710 <span class="comment">    /// \param[in] reg Register number, one of RF22_REG_*</span>
<a name="l00711"></a>00711 <span class="comment">    /// \return The value of the register</span>
<a name="l00712"></a>00712 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#a04d7944afdf214f1388ea2bbe52f2fee">spiRead</a>(uint8_t reg);
<a name="l00713"></a>00713 <span class="comment"></span>
<a name="l00714"></a>00714 <span class="comment">    /// Writes a single byte to the RF22</span>
<a name="l00715"></a>00715 <span class="comment">    /// \param[in] reg Register number, one of RF22_REG_*</span>
<a name="l00716"></a>00716 <span class="comment">    /// \param[in] val The value to write</span>
<a name="l00717"></a>00717 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a02bb8ac61e753e0354b87be423adf2e4">spiWrite</a>(uint8_t reg, uint8_t val);
<a name="l00718"></a>00718 <span class="comment"></span>
<a name="l00719"></a>00719 <span class="comment">    /// Reads a number of consecutive registers from the RF22 using burst read mode</span>
<a name="l00720"></a>00720 <span class="comment">    /// \param[in] reg Register number of the first register, one of RF22_REG_*</span>
<a name="l00721"></a>00721 <span class="comment">    /// \param[in] dest Array to write the register values to. Must be at least len bytes</span>
<a name="l00722"></a>00722 <span class="comment">    /// \param[in] len Number of bytes to read</span>
<a name="l00723"></a>00723 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#aa90b554e2ec209f6bd8bcef17b11ebb8">spiBurstRead</a>(uint8_t reg, uint8_t* dest, uint8_t len);
<a name="l00724"></a>00724 <span class="comment"></span>
<a name="l00725"></a>00725 <span class="comment">    /// Write a number of consecutive registers using burst write mode</span>
<a name="l00726"></a>00726 <span class="comment">    /// \param[in] reg Register number of the first register, one of RF22_REG_*</span>
<a name="l00727"></a>00727 <span class="comment">    /// \param[in] src Array of new register values to write. Must be at least len bytes</span>
<a name="l00728"></a>00728 <span class="comment">    /// \param[in] len Number of bytes to write</span>
<a name="l00729"></a>00729 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a361154fdf3b19ba6a5a75f832df6a1b8">spiBurstWrite</a>(uint8_t reg, uint8_t* src, uint8_t len);
<a name="l00730"></a>00730 <span class="comment"></span>
<a name="l00731"></a>00731 <span class="comment">    /// Reads and returns the device status register RF22_REG_02_DEVICE_STATUS</span>
<a name="l00732"></a>00732 <span class="comment">    /// \return The value of the device status register</span>
<a name="l00733"></a>00733 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#adb03689501d256ce896ee688c7ce83e0">statusRead</a>();
<a name="l00734"></a>00734   <span class="comment"></span>
<a name="l00735"></a>00735 <span class="comment">    /// Reads a value from the on-chip analog-digital converter</span>
<a name="l00736"></a>00736 <span class="comment">    /// \param[in] adcsel Selects the ADC input to measure. One of RF22_ADCSEL_*. Defaults to the </span>
<a name="l00737"></a>00737 <span class="comment">    /// internal temperature sensor</span>
<a name="l00738"></a>00738 <span class="comment">    /// \param[in] adcref Specifies the refernce voltage to use. One of RF22_ADCREF_*. </span>
<a name="l00739"></a>00739 <span class="comment">    /// Defaults to the internal bandgap voltage.</span>
<a name="l00740"></a>00740 <span class="comment">    /// \param[in] adcgain Amplifier gain selection. </span>
<a name="l00741"></a>00741 <span class="comment">    /// \param[in] adcoffs Amplifier offseet (0 to 15).</span>
<a name="l00742"></a>00742 <span class="comment">    /// \return The analog value. 0 to 255.</span>
<a name="l00743"></a>00743 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#ad2b1d47ce5efa8e38330be8d11741dab">adcRead</a>(uint8_t adcsel = RF22_ADCSEL_INTERNAL_TEMPERATURE_SENSOR,
<a name="l00744"></a>00744                            uint8_t adcref = RF22_ADCREF_BANDGAP_VOLTAGE,
<a name="l00745"></a>00745                            uint8_t adcgain = 0, 
<a name="l00746"></a>00746                            uint8_t adcoffs = 0);
<a name="l00747"></a>00747 <span class="comment"></span>
<a name="l00748"></a>00748 <span class="comment">    /// Reads the on-chip temperature sensoer</span>
<a name="l00749"></a>00749 <span class="comment">    /// \param[in] tsrange Specifies the temperature range to use. One of RF22_TSRANGE_*</span>
<a name="l00750"></a>00750 <span class="comment">    /// \param[in] tvoffs Specifies the temperature value offset. This is actually signed value </span>
<a name="l00751"></a>00751 <span class="comment">    /// added to the measured temperature value</span>
<a name="l00752"></a>00752 <span class="comment">    /// \return The measured temperature.</span>
<a name="l00753"></a>00753 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#a198541714d52ac7bc2c9ef10c2e28bb2">temperatureRead</a>(uint8_t tsrange = RF22_TSRANGE_M64_64C, uint8_t tvoffs = 0);   
<a name="l00754"></a>00754 <span class="comment"></span>
<a name="l00755"></a>00755 <span class="comment">    /// Reads the wakeup timer value in registers RF22_REG_17_WAKEUP_TIMER_VALUE1 </span>
<a name="l00756"></a>00756 <span class="comment">    /// and RF22_REG_18_WAKEUP_TIMER_VALUE2</span>
<a name="l00757"></a>00757 <span class="comment">    /// \return The wakeup timer value </span>
<a name="l00758"></a>00758 <span class="comment"></span>    uint16_t       <a class="code" href="classRF22.html#a7a0b9fb632f05b2eb0c559b7edb99ef5">wutRead</a>();
<a name="l00759"></a>00759 <span class="comment"></span>
<a name="l00760"></a>00760 <span class="comment">    /// Sets the wakeup timer period registers RF22_REG_14_WAKEUP_TIMER_PERIOD1,</span>
<a name="l00761"></a>00761 <span class="comment">    /// RF22_REG_15_WAKEUP_TIMER_PERIOD2 and RF22_REG_16_WAKEUP_TIMER_PERIOD3</span>
<a name="l00762"></a>00762 <span class="comment">    /// \param[in] wtm Wakeup timer mantissa value</span>
<a name="l00763"></a>00763 <span class="comment">    /// \param[in] wtr Wakeup timer exponent R value</span>
<a name="l00764"></a>00764 <span class="comment">    /// \param[in] wtd Wakeup timer exponent D value</span>
<a name="l00765"></a>00765 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#aaa1cfb845d90a0d83a508e2bc7f3492f">setWutPeriod</a>(uint16_t wtm, uint8_t wtr = 0, uint8_t wtd = 0);
<a name="l00766"></a>00766 <span class="comment"></span>
<a name="l00767"></a>00767 <span class="comment">    /// Sets the transmitter and receiver centre frequency</span>
<a name="l00768"></a>00768 <span class="comment">    /// \param[in] centre Frequency in MHz. 240.0 to 960.0. Caution, some versions of RF22 and derivatives </span>
<a name="l00769"></a>00769 <span class="comment">    /// implemented more restricted frequency ranges.</span>
<a name="l00770"></a>00770 <span class="comment">    /// \return true if the selected frquency centre + (fhch * fhs) is within range</span>
<a name="l00771"></a>00771 <span class="comment"></span>    <span class="keywordtype">boolean</span>        <a class="code" href="classRF22.html#a0e7991fe8e280e2ad1a1b1643e7cf8d7">setFrequency</a>(<span class="keywordtype">float</span> centre);
<a name="l00772"></a>00772 <span class="comment"></span>
<a name="l00773"></a>00773 <span class="comment">    /// Sets the frequency hopping step size.</span>
<a name="l00774"></a>00774 <span class="comment">    /// \param[in] fhs Frequency Hopping step size in 10kHz increments</span>
<a name="l00775"></a>00775 <span class="comment">    /// \return true if centre + (fhch * fhs) is within limits</span>
<a name="l00776"></a>00776 <span class="comment"></span>    <span class="keywordtype">boolean</span>        <a class="code" href="classRF22.html#a9e005e1170adb82a4b23c3865c059489">setFHStepSize</a>(uint8_t fhs);
<a name="l00777"></a>00777 <span class="comment"></span>
<a name="l00778"></a>00778 <span class="comment">    /// Sets the frequncy hopping channel. Adds fhch * fhs to centre frequency</span>
<a name="l00779"></a>00779 <span class="comment">    /// \param[in] fhch The channel number</span>
<a name="l00780"></a>00780 <span class="comment">    /// \return true if the selected frquency centre + (fhch * fhs) is within range</span>
<a name="l00781"></a>00781 <span class="comment"></span>    <span class="keywordtype">boolean</span>        <a class="code" href="classRF22.html#a75b29b4a26da4000b3b1922efc5163aa">setFHChannel</a>(uint8_t fhch);
<a name="l00782"></a>00782 <span class="comment"></span>
<a name="l00783"></a>00783 <span class="comment">    /// Reads and returns the current RSSI value from register RF22_REG_26_RSSI</span>
<a name="l00784"></a>00784 <span class="comment">    /// \return The current RSSI value </span>
<a name="l00785"></a>00785 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#a022c0040eb83a6f8a02b274b74a3ba67">rssiRead</a>();
<a name="l00786"></a>00786 <span class="comment"></span>
<a name="l00787"></a>00787 <span class="comment">    /// Reads and returns the current EZMAC value from register RF22_REG_31_EZMAC_STATUS</span>
<a name="l00788"></a>00788 <span class="comment">    /// \return The current EZMAC value</span>
<a name="l00789"></a>00789 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#a24eb41c972beb66d4546552e571c2e46">ezmacStatusRead</a>();
<a name="l00790"></a>00790 <span class="comment"></span>
<a name="l00791"></a>00791 <span class="comment">    /// Sets the parameters for the RF22 Idle mode in register RF22_REG_07_OPERATING_MODE. </span>
<a name="l00792"></a>00792 <span class="comment">    /// Idle mode is the mode the RF22 wil be in when not transmitting or receiving. The default idle mode </span>
<a name="l00793"></a>00793 <span class="comment">    /// is RF22_XTON ie READY mode. </span>
<a name="l00794"></a>00794 <span class="comment">    /// \param[in] mode MAsk of mode bits, using RF22_SWRES, RF22_ENLBD, RF22_ENWT, </span>
<a name="l00795"></a>00795 <span class="comment">    /// RF22_X32KSEL, RF22_PLLON, RF22_XTON.</span>
<a name="l00796"></a>00796 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a575ea3832c613df195bb2ee6201a47b8">setMode</a>(uint8_t mode);
<a name="l00797"></a>00797 <span class="comment"></span>
<a name="l00798"></a>00798 <span class="comment">    /// If current mode is Rx or Tx changes it to Idle. If the transmitter or receiver is running, </span>
<a name="l00799"></a>00799 <span class="comment">    /// disables them.</span>
<a name="l00800"></a>00800 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#ac4aebfef449c26e2dc2a9ef0737bddec">setModeIdle</a>();
<a name="l00801"></a>00801 <span class="comment"></span>
<a name="l00802"></a>00802 <span class="comment">    /// If current mode is Tx or Idle, changes it to Rx. </span>
<a name="l00803"></a>00803 <span class="comment">    /// Starts the receiver in the RF22.</span>
<a name="l00804"></a>00804 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a1e251effd6282a9a0de7dbffa192930d">setModeRx</a>();
<a name="l00805"></a>00805 <span class="comment"></span>
<a name="l00806"></a>00806 <span class="comment">    /// If current mode is Rx or Idle, changes it to Rx. </span>
<a name="l00807"></a>00807 <span class="comment">    /// Starts the transmitter in the RF22.</span>
<a name="l00808"></a>00808 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#afe3ecb6c7a99cd007ac1ac1e77b6d5a6">setModeTx</a>();
<a name="l00809"></a>00809 <span class="comment"></span>
<a name="l00810"></a>00810 <span class="comment">    /// Sets the transmitter power output level in register RF22_REG_6D_TX_POWER.</span>
<a name="l00811"></a>00811 <span class="comment">    /// Be a good neighbour and set the lowest power level you need.</span>
<a name="l00812"></a>00812 <span class="comment">    /// After init(), the power wil be set to RF22_TXPOW_8DBM.</span>
<a name="l00813"></a>00813 <span class="comment">    /// Caution: In some countries you may only select RF22_TXPOW_17DBM if you</span>
<a name="l00814"></a>00814 <span class="comment">    /// are also using frequency hopping.</span>
<a name="l00815"></a>00815 <span class="comment">    /// \param[in] power Transmitter power level, one of RF22_TXPOW_*</span>
<a name="l00816"></a>00816 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a5b8a05586f69cbbae0589e5aabf46319">setTxPower</a>(uint8_t power);
<a name="l00817"></a>00817 <span class="comment"></span>
<a name="l00818"></a>00818 <span class="comment">    /// Sets all the registered required to configure the data modem in the RF22, including the data rate, </span>
<a name="l00819"></a>00819 <span class="comment">    /// bandwidths etc. You cas use this to configure the modem with custom configuraitons if none of the </span>
<a name="l00820"></a>00820 <span class="comment">    /// canned configurations in ModemConfigChoice suit you.</span>
<a name="l00821"></a>00821 <span class="comment">    /// \param[in] config A ModemConfig structure containing values for the modem configuration registers.</span>
<a name="l00822"></a>00822 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#ab1a1260a3f97788ad88e9c68b5d8549e">setModemRegisters</a>(ModemConfig* config);
<a name="l00823"></a>00823 <span class="comment"></span>
<a name="l00824"></a>00824 <span class="comment">    /// Select one of the predefined modem configurations. If you need a modem configuration not provided </span>
<a name="l00825"></a>00825 <span class="comment">    /// here, use setModemRegisters() with your own ModemConfig.</span>
<a name="l00826"></a>00826 <span class="comment">    /// \param[in] index The configuration choice.</span>
<a name="l00827"></a>00827 <span class="comment">    /// \return true if index is a valid choice.</span>
<a name="l00828"></a>00828 <span class="comment"></span>    <span class="keywordtype">boolean</span>        <a class="code" href="classRF22.html#a266974655d5291ba1fa018991a7a818c">setModemConfig</a>(<a class="code" href="classRF22.html#a76cd019f98e4f17d9ec00e54e5947ca1">ModemConfigChoice</a> index);
<a name="l00829"></a>00829 <span class="comment"></span>
<a name="l00830"></a>00830 <span class="comment">    /// Starts the receiver and checks whether a received message is available.</span>
<a name="l00831"></a>00831 <span class="comment">    /// This can be called multiple times in a timeout loop</span>
<a name="l00832"></a>00832 <span class="comment">    /// \return true if a complete, valid message has been received and is able to be retrieved by</span>
<a name="l00833"></a>00833 <span class="comment">    /// recv()</span>
<a name="l00834"></a>00834 <span class="comment"></span>    <span class="keywordtype">boolean</span>        <a class="code" href="classRF22.html#af899b8b15c5c4b345e7f9860d45d0292">available</a>();
<a name="l00835"></a>00835 <span class="comment"></span>
<a name="l00836"></a>00836 <span class="comment">    /// Starts the receiver and blocks until a valid received </span>
<a name="l00837"></a>00837 <span class="comment">    /// message is available.</span>
<a name="l00838"></a>00838 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#aaab37b212a4f003b00040caec8e1a343">waitAvailable</a>();
<a name="l00839"></a>00839 <span class="comment"></span>
<a name="l00840"></a>00840 <span class="comment">    /// Starts the receiver and blocks until a received message is available or a timeout</span>
<a name="l00841"></a>00841 <span class="comment">    /// \param[in] timeout Maximum time to wait in milliseconds.</span>
<a name="l00842"></a>00842 <span class="comment">    /// \return true if a message is available</span>
<a name="l00843"></a>00843 <span class="comment"></span>    <span class="keywordtype">bool</span>           <a class="code" href="classRF22.html#ae7ba6ed148434bea785b2aaa1dedf2d3">waitAvailableTimeout</a>(uint16_t timeout);
<a name="l00844"></a>00844 <span class="comment"></span>
<a name="l00845"></a>00845 <span class="comment">    /// Turns the receiver on if it not already on.</span>
<a name="l00846"></a>00846 <span class="comment">    /// If there is a valid message available, copy it to buf and return true</span>
<a name="l00847"></a>00847 <span class="comment">    /// else return false.</span>
<a name="l00848"></a>00848 <span class="comment">    /// If a message is copied, *len is set to the length (Caution, 0 length messages are permitted).</span>
<a name="l00849"></a>00849 <span class="comment">    /// You should be sure to call this function frequently enough to not miss any messages</span>
<a name="l00850"></a>00850 <span class="comment">    /// It is recommended that you call it in your main loop.</span>
<a name="l00851"></a>00851 <span class="comment">    /// \param[in] buf Location to copy the received message</span>
<a name="l00852"></a>00852 <span class="comment">    /// \param[in,out] len Pointer to available space in buf. Set to the actual number of octets copied.</span>
<a name="l00853"></a>00853 <span class="comment">    /// \return true if a valid message was copied to buf</span>
<a name="l00854"></a>00854 <span class="comment"></span>    <span class="keywordtype">boolean</span>        <a class="code" href="classRF22.html#a2f6f295a313e1ebf244b91338ed22f13">recv</a>(uint8_t* buf, uint8_t* len);
<a name="l00855"></a>00855 <span class="comment"></span>
<a name="l00856"></a>00856 <span class="comment">    /// Loads a message into the transmitter and starts the transmitter. Note that a message length</span>
<a name="l00857"></a>00857 <span class="comment">    /// of 0 is permitted, in which case data may be NULL.</span>
<a name="l00858"></a>00858 <span class="comment">    /// \param[in] data Array of data to be sent</span>
<a name="l00859"></a>00859 <span class="comment">    /// \param[in] len Number of bytes of data to send.</span>
<a name="l00860"></a>00860 <span class="comment">    /// \return true</span>
<a name="l00861"></a>00861 <span class="comment"></span>    <span class="keywordtype">boolean</span>        <a class="code" href="classRF22.html#a217941f83c9f645350cf7d5d16d8cc3d">send</a>(uint8_t* data, uint8_t len);
<a name="l00862"></a>00862 <span class="comment"></span>
<a name="l00863"></a>00863 <span class="comment">    /// Blocks until the current message </span>
<a name="l00864"></a>00864 <span class="comment">    /// (if any) has been completely sent</span>
<a name="l00865"></a>00865 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a8ce6d4f63ce1ea37ab108c01f9476555">waitPacketSent</a>();
<a name="l00866"></a>00866   <span class="comment"></span>
<a name="l00867"></a>00867 <span class="comment">    /// Tells the receiver to accept messages with any TO address, not just messages</span>
<a name="l00868"></a>00868 <span class="comment">    /// addressed to this node or the broadcast address</span>
<a name="l00869"></a>00869 <span class="comment">    /// \param[in] promiscuous true if you wish to receive messages with any TO address</span>
<a name="l00870"></a>00870 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#ae526f968b1571e8bf71344c2f8a425d5">setPromiscuous</a>(<span class="keywordtype">boolean</span> promiscuous);
<a name="l00871"></a>00871 <span class="comment"></span>
<a name="l00872"></a>00872 <span class="comment">    /// Returns the TO header of the last received message</span>
<a name="l00873"></a>00873 <span class="comment">    /// \return The TO header</span>
<a name="l00874"></a>00874 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#ad61bb70ba171a81fa8803219fdc2a433">headerTo</a>();
<a name="l00875"></a>00875 <span class="comment"></span>
<a name="l00876"></a>00876 <span class="comment">    /// Returns the FROM header of the last received message</span>
<a name="l00877"></a>00877 <span class="comment">    /// \return The FROM header</span>
<a name="l00878"></a>00878 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#a3d8d98b524d14519f6c39d7136b5a422">headerFrom</a>();
<a name="l00879"></a>00879 <span class="comment"></span>
<a name="l00880"></a>00880 <span class="comment">    /// Returns the ID header of the last received message</span>
<a name="l00881"></a>00881 <span class="comment">    /// \return The ID header</span>
<a name="l00882"></a>00882 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#a74b21003336cc7c6aac1dad128b1f205">headerId</a>();
<a name="l00883"></a>00883 <span class="comment"></span>
<a name="l00884"></a>00884 <span class="comment">    /// Returns the FLAGS header of the last received message</span>
<a name="l00885"></a>00885 <span class="comment">    /// \return The FLAGS header</span>
<a name="l00886"></a>00886 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#a3ecbb26863c8bd4bf8cbacde37b73d4f">headerFlags</a>();
<a name="l00887"></a>00887 <span class="comment"></span>
<a name="l00888"></a>00888 <span class="comment">    /// Returns the RSSI (Receiver Signal Strength Indicator)</span>
<a name="l00889"></a>00889 <span class="comment">    /// of the last received message. This measurement is taken when </span>
<a name="l00890"></a>00890 <span class="comment">    /// the preamble has been received. It is a (non-linear) measure of the received signal strength.</span>
<a name="l00891"></a>00891 <span class="comment">    /// \return The RSSI</span>
<a name="l00892"></a>00892 <span class="comment"></span>    uint8_t        <a class="code" href="classRF22.html#a07786683889cac7f62ff649d5338b838">lastRssi</a>();
<a name="l00893"></a>00893 
<a name="l00894"></a>00894 <span class="keyword">protected</span>:<span class="comment"></span>
<a name="l00895"></a>00895 <span class="comment">    /// Sets the message preamble length in RF22_REG_34_PREAMBLE_LENGTH</span>
<a name="l00896"></a>00896 <span class="comment">    /// \param[in] nibbles Preamble length in nibbles of 4 bits each.  </span>
<a name="l00897"></a>00897 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a3ef02152274ab7ed9f01bf9d14323b2f">setPreambleLength</a>(uint8_t nibbles);
<a name="l00898"></a>00898 <span class="comment"></span>
<a name="l00899"></a>00899 <span class="comment">    /// Sets the sync words for transmit and receive in registers RF22_REG_36_SYNC_WORD3 </span>
<a name="l00900"></a>00900 <span class="comment">    /// to RF22_REG_39_SYNC_WORD0</span>
<a name="l00901"></a>00901 <span class="comment">    /// \param[in] syncWords Array of sync words</span>
<a name="l00902"></a>00902 <span class="comment">    /// \param[in] len Number of sync words to set</span>
<a name="l00903"></a>00903 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a4ac022de6099c087a3188c4d6028f97f">setSyncWords</a>(uint8_t* syncWords, uint8_t len);
<a name="l00904"></a>00904 <span class="comment"></span>
<a name="l00905"></a>00905 <span class="comment">    /// This is a low level function to handle the interrupts for one instance of RF22.</span>
<a name="l00906"></a>00906 <span class="comment">    /// Called automatically by isr0() and isr1()</span>
<a name="l00907"></a>00907 <span class="comment">    /// Should not need to be called.</span>
<a name="l00908"></a>00908 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#ae4d40dd937c71fa0094a838297fc315d">handleInterrupt</a>();
<a name="l00909"></a>00909 <span class="comment"></span>
<a name="l00910"></a>00910 <span class="comment">    /// Clears the receiver buffer.</span>
<a name="l00911"></a>00911 <span class="comment">    /// Internal use only</span>
<a name="l00912"></a>00912 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a68be2dd2c22416a9c70fabea8928ff1a">clearRxBuf</a>();
<a name="l00913"></a>00913 <span class="comment"></span>
<a name="l00914"></a>00914 <span class="comment">    /// Clears the transmitter buffer</span>
<a name="l00915"></a>00915 <span class="comment">    /// Internal use only</span>
<a name="l00916"></a>00916 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#addd900063898086342232db06edc4008">clearTxBuf</a>();
<a name="l00917"></a>00917 <span class="comment"></span>
<a name="l00918"></a>00918 <span class="comment">    /// Fills the transmitter buffer with the data of a mesage to be sent</span>
<a name="l00919"></a>00919 <span class="comment">    /// \param[in] data Array of data bytes to be sent (0 to 255)</span>
<a name="l00920"></a>00920 <span class="comment">    /// \param[in] len Number of data bytes in data</span>
<a name="l00921"></a>00921 <span class="comment">    /// \return true</span>
<a name="l00922"></a>00922 <span class="comment"></span>    <span class="keywordtype">boolean</span>           <a class="code" href="classRF22.html#a9c7e029590cfe83b364c7c02559575be">fillTxBuf</a>(uint8_t* data, uint8_t len);
<a name="l00923"></a>00923 <span class="comment"></span>
<a name="l00924"></a>00924 <span class="comment">    /// Appends the transmitter buffer with the data of a mesage to be sent</span>
<a name="l00925"></a>00925 <span class="comment">    /// \param[in] data Array of data bytes to be sent (0 to 255)</span>
<a name="l00926"></a>00926 <span class="comment">    /// \param[in] len Number of data bytes in data</span>
<a name="l00927"></a>00927 <span class="comment">    /// \return false if the resulting message would exceed RF22_MAX_MESSAGE_LEN, else true</span>
<a name="l00928"></a>00928 <span class="comment"></span>    <span class="keywordtype">boolean</span>           <a class="code" href="classRF22.html#a199d9f0b69ce539097d729376c551fb8">appendTxBuf</a>(uint8_t* data, uint8_t len);
<a name="l00929"></a>00929 <span class="comment"></span>
<a name="l00930"></a>00930 <span class="comment">    /// Internal function to load the next fragment of </span>
<a name="l00931"></a>00931 <span class="comment">    /// the current message into the transmitter FIFO</span>
<a name="l00932"></a>00932 <span class="comment">    /// Internal use only</span>
<a name="l00933"></a>00933 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a6540f75448cca7b21b69bce0b5816cd9">sendNextFragment</a>();
<a name="l00934"></a>00934 <span class="comment"></span>
<a name="l00935"></a>00935 <span class="comment">    ///  function to copy the next fragment from </span>
<a name="l00936"></a>00936 <span class="comment">    /// the receiver FIF) into the receiver buffer</span>
<a name="l00937"></a>00937 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a9edc9967b9536074e5f58dd4a5815def">readNextFragment</a>();
<a name="l00938"></a>00938 <span class="comment"></span>
<a name="l00939"></a>00939 <span class="comment">    /// Clears the RF22 Rx and Tx FIFOs</span>
<a name="l00940"></a>00940 <span class="comment">    /// Internal use only</span>
<a name="l00941"></a>00941 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a80f1d86f8ce76126639de6aad89c0389">resetFifos</a>();
<a name="l00942"></a>00942 <span class="comment"></span>
<a name="l00943"></a>00943 <span class="comment">    /// Clears the RF22 Rx FIFO</span>
<a name="l00944"></a>00944 <span class="comment">    /// Internal use only</span>
<a name="l00945"></a>00945 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a2bdccb7c4084634d246add95005d5e53">resetRxFifo</a>();
<a name="l00946"></a>00946 <span class="comment"></span>
<a name="l00947"></a>00947 <span class="comment">    /// Clears the RF22 Tx FIFO</span>
<a name="l00948"></a>00948 <span class="comment">    /// Internal use only</span>
<a name="l00949"></a>00949 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#adffb1a63931286ecc01ffec9d99cfa6f">resetTxFifo</a>();
<a name="l00950"></a>00950 <span class="comment"></span>
<a name="l00951"></a>00951 <span class="comment">    /// This function will be called by handleInterrupt() if an RF22 external interrupt occurs. </span>
<a name="l00952"></a>00952 <span class="comment">    /// This can only happen if external interrupts are enabled in the RF22 </span>
<a name="l00953"></a>00953 <span class="comment">    /// (which they are not by default). </span>
<a name="l00954"></a>00954 <span class="comment">    /// Subclasses may override this function to get control when  an RF22 external interrupt occurs. </span>
<a name="l00955"></a>00955 <span class="comment"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span>   <a class="code" href="classRF22.html#aa9a67b1e368b56722c52ab79ded84e82">handleExternalInterrupt</a>();
<a name="l00956"></a>00956 <span class="comment"></span>
<a name="l00957"></a>00957 <span class="comment">    /// This function will be called by handleInterrupt() if an RF22 wakeup timer interrupt occurs. </span>
<a name="l00958"></a>00958 <span class="comment">    /// This can only happen if wakeup timer interrupts are enabled in the RF22 </span>
<a name="l00959"></a>00959 <span class="comment">    /// (which they are not by default). </span>
<a name="l00960"></a>00960 <span class="comment">    /// Subclasses may override this function to get control when  an RF22 wakeup timer interrupt occurs. </span>
<a name="l00961"></a>00961 <span class="comment"></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span>   <a class="code" href="classRF22.html#ab7f8d2337bdde953983cd0dea5d847ba">handleWakeupTimerInterrupt</a>();
<a name="l00962"></a>00962 <span class="comment"></span>
<a name="l00963"></a>00963 <span class="comment">    /// Sets the TO header to be sent in all subsequent messages</span>
<a name="l00964"></a>00964 <span class="comment">    /// \param[in] to The new TO header value</span>
<a name="l00965"></a>00965 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#ac45b0f89bb116d546cc5e90410173827">setHeaderTo</a>(uint8_t to);
<a name="l00966"></a>00966 <span class="comment"></span>
<a name="l00967"></a>00967 <span class="comment">    /// Sets the FROM header to be sent in all subsequent messages</span>
<a name="l00968"></a>00968 <span class="comment">    /// \param[in] from The new FROM header value</span>
<a name="l00969"></a>00969 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#af446e330a074e528253f3c7706b14b09">setHeaderFrom</a>(uint8_t from);
<a name="l00970"></a>00970 <span class="comment"></span>
<a name="l00971"></a>00971 <span class="comment">    /// Sets the ID header to be sent in all subsequent messages</span>
<a name="l00972"></a>00972 <span class="comment">    /// \param[in] id The new ID header value</span>
<a name="l00973"></a>00973 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a7a36edc1913d6cec8892af8ea8a28ef7">setHeaderId</a>(uint8_t <span class="keywordtype">id</span>);
<a name="l00974"></a>00974 <span class="comment"></span>
<a name="l00975"></a>00975 <span class="comment">    /// Sets the FLAGS header to be sent in all subsequent messages</span>
<a name="l00976"></a>00976 <span class="comment">    /// \param[in] flags The new FLAGS header value</span>
<a name="l00977"></a>00977 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#adb3ce5021865459e770e45cc434a0dd0">setHeaderFlags</a>(uint8_t flags);
<a name="l00978"></a>00978 <span class="comment"></span>
<a name="l00979"></a>00979 <span class="comment">    /// Start the transmission of the contents </span>
<a name="l00980"></a>00980 <span class="comment">    /// of the Tx buffer</span>
<a name="l00981"></a>00981 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#ae714b47446f34aca958df75b75f811b3">startTransmit</a>();
<a name="l00982"></a>00982 <span class="comment"></span>
<a name="l00983"></a>00983 <span class="comment">    /// ReStart the transmission of the contents </span>
<a name="l00984"></a>00984 <span class="comment">    /// of the Tx buffer after a atransmission failure</span>
<a name="l00985"></a>00985 <span class="comment"></span>    <span class="keywordtype">void</span>           <a class="code" href="classRF22.html#a7c1a0bfb8f05d0af540e37e4883e212e">restartTransmit</a>();
<a name="l00986"></a>00986 
<a name="l00987"></a>00987 <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00988"></a>00988 <span class="comment">    /// Low level interrupt service routine for RF22 connected to interrupt 0</span>
<a name="l00989"></a>00989 <span class="comment"></span>    <span class="keyword">static</span> <span class="keywordtype">void</span>         isr0();
<a name="l00990"></a>00990 <span class="comment"></span>
<a name="l00991"></a>00991 <span class="comment">    /// Low level interrupt service routine for RF22 connected to interrupt 1</span>
<a name="l00992"></a>00992 <span class="comment"></span>    <span class="keyword">static</span> <span class="keywordtype">void</span>         isr1();
<a name="l00993"></a>00993 <span class="comment"></span>
<a name="l00994"></a>00994 <span class="comment">    /// Array of instances connected to interrupts 0 and 1</span>
<a name="l00995"></a>00995 <span class="comment"></span>    <span class="keyword">static</span> <a class="code" href="classRF22.html" title="Send and receive unaddressed, unreliable datagrams.">RF22</a>*        _RF22ForInterrupt[];
<a name="l00996"></a>00996 
<a name="l00997"></a>00997     uint8_t             _mode; <span class="comment">// One of RF22_MODE_*</span>
<a name="l00998"></a>00998 
<a name="l00999"></a>00999     uint8_t             _idleMode;
<a name="l01000"></a>01000     uint8_t             _slaveSelectPin;
<a name="l01001"></a>01001     uint8_t             _interrupt;
<a name="l01002"></a>01002     uint8_t             _deviceType;
<a name="l01003"></a>01003 
<a name="l01004"></a>01004     <span class="comment">// These volatile members may get changed in the interrupt service routine</span>
<a name="l01005"></a>01005     uint8_t             _buf[RF22_MAX_MESSAGE_LEN];
<a name="l01006"></a>01006     <span class="keyword">volatile</span> uint8_t    _bufLen;
<a name="l01007"></a>01007 
<a name="l01008"></a>01008     <span class="keyword">volatile</span> <span class="keywordtype">boolean</span>    _rxBufValid;
<a name="l01009"></a>01009 
<a name="l01010"></a>01010     <span class="keyword">volatile</span> <span class="keywordtype">boolean</span>    _txPacketSent;
<a name="l01011"></a>01011     <span class="keyword">volatile</span> uint8_t    _txBufSentIndex;
<a name="l01012"></a>01012   
<a name="l01013"></a>01013     <span class="keyword">volatile</span> uint16_t   _rxBad;
<a name="l01014"></a>01014     <span class="keyword">volatile</span> uint16_t   _rxGood;
<a name="l01015"></a>01015     <span class="keyword">volatile</span> uint16_t   _txGood;
<a name="l01016"></a>01016 
<a name="l01017"></a>01017     <span class="keyword">volatile</span> uint8_t    _lastRssi;
<a name="l01018"></a>01018 };
<a name="l01019"></a>01019 
<a name="l01020"></a>01020 
<a name="l01021"></a>01021 <span class="preprocessor">#endif </span>
</pre></div></div>
</div>


<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
